Skip to content
$ learn socks5

What is a SOCKS5 proxy?

How SOCKS5 relays traffic, how it differs from other proxies, and how to test one.

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:

  1. Greeting. The client lists the authentication methods it supports (none, or username and password).
  2. Method choice. The proxy picks one. If it picks username and password, the client sends its credentials and the proxy accepts or rejects them.
  3. Request. The client sends a CONNECT request with the target address, which can be an IPv4 address, an IPv6 address or a domain name.
  4. 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

What a SOCKS5 proxy does not do

Common uses

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

Published and last updated 2026-12-02