A SOCKS5 proxy is a server that relays network connections on your behalf. You connect to the proxy, tell it which host and port you want, and it opens that connection and passes bytes back and forth. It does not need to understand the protocol inside, which is why one SOCKS5 proxy can carry web traffic, email, SSH, game traffic over TCP, or anything else built on TCP.
How SOCKS5 works
SOCKS5 is defined in RFC 1928, with username and password authentication in RFC 1929. A connection goes through a short handshake before any of your data moves:
- Greeting. The client lists the authentication methods it supports (none, or username and password).
- Method choice. The proxy picks one. If it picks username and password, the client sends its credentials and the proxy accepts or rejects them.
- Request. The client sends a CONNECT request with the target address, which can be an IPv4 address, an IPv6 address or a domain name.
- Reply. The proxy attempts the connection and reports success or an error code. After success, it simply forwards bytes in both directions.
Because the proxy only forwards bytes, it does not add HTTP headers such as X-Forwarded-For on its own. What the destination sees is the proxy's IP address as the source of the connection.
What SOCKS5 adds over older versions
- Authentication. SOCKS4 has no real authentication. SOCKS5 supports username and password.
- Domain names. With SOCKS5 the client can send a hostname and let the proxy resolve it, which avoids leaking DNS queries from your own machine.
- IPv6. SOCKS5 can address IPv6 targets.
- UDP. The specification includes UDP ASSOCIATE for UDP traffic. Many public proxies do not implement it, and our checker does not test it.
What a SOCKS5 proxy does not do
- It does not encrypt traffic. Between you and the proxy, and between the proxy and the target, data is as plain or as encrypted as the protocol you run over it. HTTPS stays encrypted end to end; plain HTTP does not.
- It is not a VPN. A VPN usually captures all traffic from a device. A SOCKS5 proxy only handles the applications you configure to use it.
- It cannot hide what you send. The operator of the proxy can see the destination of every connection and, for unencrypted protocols, the content.
Common uses
- Web scraping and automation where traffic must come from different IP addresses.
- Reaching a service from a different network location, for testing.
- Tunnelling SSH, database or messaging traffic that is not HTTP, using tools such as
ssh -Dto create a local SOCKS5 port. - Browsers and torrent clients that have a SOCKS5 setting.
Using a SOCKS5 proxy with curl
curl supports SOCKS5 directly. The socks5h scheme asks the proxy to resolve the hostname, while socks5 resolves it locally:
curl --proxy socks5h://203.0.113.10:1080 https://api.ipify.org # with username and password curl --proxy socks5h://user:[email protected]:1080 https://api.ipify.org
If the command prints the proxy's IP address rather than your own, traffic is going through it. The addresses above are documentation examples; replace them with your own proxy.
How to test a SOCKS5 proxy
A proxy can listen on a port and still be useless, so test the whole path: TCP connect, handshake, authentication, and a real request through it. Paste the proxy as ip:port (or ip:port:user:pass) into the proxy checker. It tries HTTP and then SOCKS5, and reports status, latency, exit IP and anonymity level. It does not test SOCKS4 or UDP.
After a proxy passes, look up its exit address with the IP lookup to see its country, ASN and proxy flags, and check the address on the blacklist checker before relying on it for anything sensitive to reputation.
Choosing between SOCKS5 and HTTP proxies
If you only handle web traffic, an HTTP proxy is often enough and may support features such as caching or header rewriting. If you need other TCP protocols, or want the proxy to stay out of the content, SOCKS5 is the better fit. The comparison is covered in HTTP vs SOCKS5 proxy, and the headers that reveal a proxy are explained in proxy anonymity levels.
Security notes
- Free public proxies can be operated by anyone. Never send passwords or personal data through one over an unencrypted protocol.
- Credentials in a proxy URL end up in shell history and logs. Prefer environment variables or config files for anything long-lived.
- A working proxy today may be dead tomorrow. Re-test lists regularly.