extremecoders-re / go-dispatch-proxy

SOCKS5/Transparent load balancing proxy developed in Go, combines multiple internet connections
MIT License
278 stars 45 forks source link

establish a TCP/IP port binding not supported #21

Closed SirSAC closed 2 years ago

SirSAC commented 2 years ago

Hello, i hope u are fine in these heavy days with the virus, i got a problem for not supporting the "establish a TCP/IP port binding" on your program, the info i got is from your source code and from wikipedia page about how socks5 works, so im wonder if u have any idea if it is possible to make support this and if u can work for this.

I tried everything but idk why but it gives me the error if i add this code (cmd_code != 0x02) with "||" between your command code and new command code for giving the error if one of these is not valid, i also tried "2" instead of "0x02" just in case.

Pls help me bro, you are the only one that understand your code, and sry im noob/new on GoLang programming language, thats why i started to try to understand your code but its bit headache when i watch the "socks.go" file and a half of "main.go" file when is about the switch between indexes.

Thanks anticipated and sry for long reading, i hope u are healthy, have a great day and good job with your program is doing its job but still not full socks5 capabilities.

extremecoders-re commented 2 years ago

It should be && rather than ||


if cmd_code != CONNECT && cmd_code != BIND {
    conn.Write([]byte{5, COMMAND_NOT_SUPPORTED, 0, 1, 0, 0, 0, 0, 0, 0})
    conn.Close()
    return "", errors.New("[WARN] unsupported command code")
}

SOCKS5 TCP/IP port binding hasn't been implemented. Ideally you would want to check the cmd_code and implement the necessary logic next.

SirSAC commented 2 years ago

Thanks, it worked for me. After making a clean code from your code, do u want to review it and told me if is better or resource friendly (CPU)?