Is SOCKS5 bind persistent, or one-time only?
I've been studying RFC 1928 and the description of the BIND operation wasn't clear to me. The setup sequence is described as follows, as I underst开发者_开发技巧and it:
- The client establishes connection to the SOCKS5 server
- The client performs the CONNECT request
- The client establishes new TCP connection to the SOCKS5 server and requests BIND
- The server replies immediately with the result of the BIND operation
- Upon receiving incoming connection, the SOCKS5 server sends the notification to the client
What is not immediately clear for me is the step 5. Do I have to re-request BIND afterwards to allow for more incoming connections?
As far as I understand, the same TCP connection (established at the step 3) is used for communication with the accepted peer. What if I need to keep accepting connections on the same address:port? Is it possible, after all?
You need a separate BIND request for each connection you want to accept, as there is only 1 notification sent back by the SOCKS proxy when a client connects to the bound port. Whether or not the SOCKS5 proxy allows multiple BIND requests on the same IP/Port depends on the proxy's implementation.
精彩评论