SOCKS5

Socket Secure Version 5Transport layer · OSI 5

Relaying arbitrary TCP and UDP streams via a proxy

Step 1 of 4: Connect TCP to proxy port 1080. An app configured for SOCKS5 dials 192.0.2.80 on port 1080 . Unlike an HTTP proxy, SOCKS5 never inspects HTTP URLs or headers inside the resulting stream.
0.0 s / 10.2 s
Your app192.168.1.10
HandshakeControlResponseRequestEncrypted

Overview

While an HTTP proxy parses web requests, opens a stream on your behalf and copies bytes untouched for any protocol: web, email, games, or SSH. Tools such as ssh -D and Tor expose a SOCKS5 port.

Defined in RFC 1928, SOCKS5 sits between application and TCP/UDP (often labelled Layer 5) on port 1080. Clients pick an auth method, ask the proxy to CONNECT by domain or IP, then stream unmodified protocol bytes.

Key facts

Layer
Between app & TCP/UDP (often Layer 5)
Default port
1080 (TCP; supports UDP Assoc)
Auth options
None (0x00) or User/Pass (0x02)
Common tools
ssh -D, Tor, corporate proxies
Defined in
RFC 1928, RFC 1929

37-byte setup opened a protocol-neutral pipe

Four tiny messages told the SOCKS5 proxy where to connect and let it handle the DNS query; after that it only copied bytes untouched between sockets.

Completed RFC 1928 method negotiation, hostname-based CONNECT (remote DNS), and blind TCP stream relay for TLS 1.3.

Setup cost
4 messages, 37 bytes total
Destination sees
192.0.2.80 (proxy IP)
DNS resolution
Handled remotely via ATYP 0x03
Outer crypto
None (inner TLS or ssh -D encrypts)

Try it yourself

Start a local SOCKS5 tunnel over SSH and test it

Create a SOCKS5 listener on port 1080 with `ssh -D` and pass traffic through `socks5h://` so DNS resolves remotely too.

curl --socks5-hostname 192.0.2.80:1080 https://example.com