What Is a SOCKS Proxy? SOCKS4 and SOCKS5 Explained
A SOCKS proxy relays connections for an app. SOCKS5 can carry TCP traffic for several application protocols and supports UDP relay when both ends implement it.

What SOCKS5 Supports
The SOCKS5 handshake lets a client ask the proxy to reach a destination by domain name, IPv4, or IPv6 address. The protocol supports authentication negotiation. How DNS is resolved depends on the client and its settings. SOCKS5 by itself does not encrypt your traffic.
SOCKS4 vs SOCKS5
SOCKS4 is an older TCP protocol with IPv4 addressing. The SOCKS4a extension adds hostnames. SOCKS5 adds address types, authentication negotiation, and a UDP relay mechanism. Start with the version your app explicitly supports.
| Version | DNS and Destinations | Authentication | IPv6 | UDP |
|---|---|---|---|---|
| SOCKS4 | Client resolves names to IPv4 | User ID field only | No | No |
| SOCKS4a | Proxy can resolve a supplied hostname | User ID field only | No native IPv6 address type | No |
| SOCKS5 | Client can send an IP or let the proxy resolve a hostname | Negotiates supported methods | Supported by the protocol | UDP ASSOCIATE if both ends support it |
SOCKS5 vs HTTP
Choose SOCKS5 if the app expects it or needs a supported connection outside ordinary web traffic. Choose an HTTP proxy when the application specifically calls for one. A host and port are only meaningful alongside a compatible protocol.
How SOCKS5 Handles DNS
SOCKS5 can accept a destination IP or a hostname. With curl --socks5, curl resolves the destination first. With curl --socks5-hostname, curl sends the hostname to the proxy for resolution.
| curl option | Resolver | What the proxy receives |
|---|---|---|
| --socks5 | The client’s configured resolver | A destination IP address |
| --socks5-hostname | The proxy’s configured resolver | A destination hostname |
With your own SOCKS5 listener running on port 1080 and a test HTTPS destination you control, try the following. Replace the example hostname before running it.
curl -v --socks5 127.0.0.1:1080 https://test.example.com/
curl -v --socks5-hostname 127.0.0.1:1080 https://test.example.com/
Look for whether curl reports a locally or remotely resolved SOCKS5 connection. If both resolutions reach the same server and the proxy allows access, both requests should return that server’s response. This test covers curl, whose other settings and proxy DNS behavior can differ from a browser’s.
Find SOCKS5 Entries
Open the SOCKS5-filtered directory. A listed endpoint can require authentication or stop responding after the provider’s last check.
