4. Requests
Once the method-dependent subnegotiation has completed, the client sends the request details. If the negotiated method includes encapsulation for purposes of integrity checking and/or confidentiality, these requests MUST be encapsulated in the method-dependent encapsulation.
The SOCKS request is formed as follows:
+----+-----+-------+------+----------+----------+
|VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT |
+----+-----+-------+------+----------+----------+
| 1 | 1 | X'00' | 1 | Variable | 2 |
+----+-----+-------+------+----------+----------+
Where:
- VER protocol version: X'05'
- CMD
- CONNECT X'01'
- BIND X'02'
- UDP ASSOCIATE X'03'
- RSV RESERVED
- ATYP address type of following address
- IP V4 address: X'01'
- DOMAINNAME: X'03'
- IP V6 address: X'04'
- DST.ADDR desired destination address
- DST.PORT desired destination port in network octet order
The SOCKS server will typically evaluate the request based on source and destination addresses, and return one or more reply messages, as appropriate for the request type.