InnocentZero's Treasure Chest

HomeFeedAbout MeList of interesting people

27 Oct 2025

SOCKS protocol and proxies

SOCKS protocol

<- Dynamic port forwarding

The protocol is used for forwarding internet traffic, particularly TCP/IP via a proxy server. Version 5 later added support for ipv6 and UDP that also allows dns lookups.

The handshake works as follows:

  • Client connects and sends a greeting, which includes a list of authentication methods.
  • Server chooses a method.
  • Client sends multiple messages now.
  • Finally the regular connection requests occur:
    • One packet from client to server with the version, command code, destination port, destination IP, and the user ID string.
    • Server responds with version, reply code, destination port and IP, which the client should bind to if the command code was BIND.

Other posts
Creative Commons License
This website by innocentzer0 is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.