Skip to content
Get Started
G2G2
4.7/5
Excellent
Trustpilot

What Is SOCKS5?

SOCKS5 is a general-purpose proxy protocol that relays a connection between a client and any host and port, without understanding the traffic inside it. Because it works below HTTP, it can carry web traffic as well as mail, SSH or database connections.

  • Session Control
  • High Speed
  • Privacy First
Best fit for SOCKS5Static ISP Proxiesfrom$0.75/IP
how it works

How SOCKS5 works

SOCKS5 is defined in RFC 1928. The client opens a TCP connection to the proxy, the two agree on an authentication method, and the client asks the proxy to connect to a destination. From then on the proxy copies bytes in both directions without reading them.

The protocol also defines BIND and UDP ASSOCIATE commands, but support for them varies, and many proxy services relay TCP only.

SOCKS5: key points
  • Greeting: the client lists the authentication methods it supports, such as 0x00 (none) and 0x02 (username and password).
  • Authentication: with method 0x02, the client sends a username and password as defined in RFC 1929. They are sent unencrypted to the proxy.
  • Request: the client sends a CONNECT command with the destination as an IPv4 address, an IPv6 address or a domain name, plus a port.
  • Relay: the proxy replies with a status code, then forwards traffic both ways until either side closes the connection.
why it matters

Why SOCKS5 matters for proxy users

SOCKS5 is the option for software that does not support HTTP proxies, such as some desktop apps, mail clients, SSH and database tools, and it is offered by many anti-detect browsers. For HTTPS websites it gives no extra privacy over an HTTP proxy: both relay an encrypted TLS connection they cannot read. The SOCKS5 vs HTTP proxies guide compares them in detail.

SOCKS5 with remote DNS in curlShell
curl --proxy socks5h://USERNAME:PASSWORD@HOST:PORT https://api.ipify.org
side by side

socks5 vs socks5h: where DNS is resolved

The request can name the destination as an IP address or as a hostname. That choice decides who resolves DNS, and most tools expose it through the scheme of the proxy URL.

  • 1

    socks5://

    Who resolves the hostname
    Your machine (in curl and Python requests)
    Effect
    DNS queries leave from your own network; the proxy only receives an IP
  • 2

    socks5h://

    Who resolves the hostname
    The proxy
    Effect
    The hostname goes to the proxy, which resolves it from its own location
  • 3

    http:// proxy

    Who resolves the hostname
    The proxy
    Effect
    HTTP proxies always receive the hostname, so there is no local lookup

Local resolution causes a DNS leak: your own resolver sees every domain you visit, and a geo-routed domain can resolve to a server for the wrong region. Use socks5h:// unless you have a reason not to.

At CleanProxies, SOCKS5 is available on static ISP proxies and ISP subnet proxies: switch the order to SOCKS5 in the dashboard and keep the same username and password. Rotating residential and mobile proxies use an HTTP(S) gateway.

Static ISP proxies from $0.75/IP

The CleanProxies proxy that fits best here, with a $4.99 trial to test it first.

Dedicated IPs on US carrier ASNs with unlimited bandwidth and threads, never shared.

starting from$0.75/IP

Dedicated static IPs registered to US and Canadian ISPs. The address stays the same for as long as you hold it, with unlimited bandwidth and HTTP(S) or SOCKS5 access.

Guides from the blog

Setup guides and best practices from the CleanProxies blog.

Get the latest insightsAll Blogs

Related terms

Terms that come up alongside SOCKS5.

All glossary terms

SOCKS5 FAQs

Straight answers about SOCKS5.

With socks5 the client resolves the hostname itself and sends the proxy an IP address. With socks5h the hostname is sent to the proxy and resolved there, so DNS lookups do not leave from your own network.

Got more questions?All FAQs