Separate the two BIND replies
04BIND asks the proxy to listen for an incoming secondary connection. Listening and accepting the peer are distinct events.
Both the listener stage and successful incoming-peer stage have completed. The secondary connection now relays peer data through the proxy to the client.
Source for this drawing: RFC 1928 · Read RFC section 6 ↗
New to this? Start hereA quick picture + helpful background
A request starts a conversation.
A client asks for a resource. A server sends a response. The method, address, headers, and status explain what that conversation means.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
A listening address is not yet a connected peer.
- BIND is used for applications needing an incoming secondary connection, normally after a primary CONNECT connection. It is a request to the SOCKS server, not a command built into FTP.
- The first reply follows socket creation/bind and reports the proxy listening address and port. The client can notify the application server over the existing primary/control connection.
- The second reply occurs only after the anticipated incoming connection succeeds or fails. Its BND.ADDR/BND.PORT identify the connecting host. Wait for this outcome before treating the incoming peer leg as established.
The primary application/control connection is assumed established and omitted from the drawing; notification is described, not a direct new SOCKS message to the peer. First reply example198.51.100.9:41000, second reply203.0.113.20:50000. Both use the same reply field names but different meanings. Held errata8867/3947 are not labeled verified. A failure at either stage follows section6 failure closing rules.
Read the RFC section ↗