SOCKS5 proxy protocol
SOCKS5 is the general-purpose proxy protocol defined in RFC 1928: the client first negotiates an authentication method with the proxy, then asks it to connect to the target, and the data is relayed unchanged.
Definition
SOCKS5 is an IETF standards-track protocol published in 1996 (RFC 1928). It sits between the application layer and the transport layer and only sets up connections and relays bytes for the client. It does not parse web content, so HTTP, SSH, mail and other TCP-based programs can all send traffic through it. Compared with SOCKS4 it adds UDP relay, authentication-method negotiation, and domain-name and IPv6 addresses.
On a proxy provider's plan page, SOCKS5 describes how you connect, not the IP type: the same residential or datacenter exit can often be reached over both HTTP and SOCKS5.
Handshake
- The client connects to the proxy port and sends version 05 plus the list of authentication methods it supports. The RFC's conventional port is TCP 1080; commercial proxies often use other ports.
- The proxy picks one method from the list: 00 means no authentication, 02 means username/password, and FF means none is acceptable, in which case the client must close the connection.
- If username/password is chosen, the client sends the username and password as defined in RFC 1929. Status 00 means success; otherwise the proxy closes the connection.
- The client sends CONNECT, BIND or UDP ASSOCIATE with an address and port. REP=00 marks this reply as successful; the next steps depend on the command: CONNECT establishes TCP forwarding, BIND waits for its required second reply, and UDP ASSOCIATE sends encapsulated datagrams separately to the specified UDP relay.
What it is good for
- Lets programs that do not support HTTP proxies send traffic, such as SSH, database clients and some scraping tools; SOCKS5 only relays bytes and does not care about the protocol above it.
- Relays UDP traffic such as DNS queries, QUIC/HTTP3 or real-time audio and video, provided both the proxy and the client implement UDP ASSOCIATE.
- Hands the target domain name to the proxy for resolution, so the DNS lookup happens on the proxy side and local resolution is less likely to reveal what you visit.
socks5:// vs socks5h://
| Syntax | Who resolves the domain | Target address sent to the proxy |
|---|---|---|
| socks5:// | The local client | The resolved IP address |
| socks5h:// | The proxy server | The domain name itself |
This is a convention used by curl and similar tools, not two protocol versions; both use RFC 1928. When Chrome uses socks5://, the proxy resolves the URL's hostname, but the Chromium documentation warns that components such as DNS prefetching may still resolve names locally.
How it differs from an HTTP proxy
| Aspect | HTTP proxy | SOCKS5 |
|---|---|---|
| How it works | Understands HTTP requests; uses the CONNECT method to open a tunnel for HTTPS sites | Does not understand the protocol above it; only sets up the connection and relays bytes |
| Traffic it can carry | Mainly HTTP and HTTPS | Any TCP; UDP can be relayed when the proxy supports UDP ASSOCIATE |
| Authentication | Proxy-Authorization request header, commonly the Basic scheme | A method chosen during negotiation, commonly RFC 1929 username/password |
| Encryption | Basic authentication is only Base64 encoding; an HTTPS proxy can encrypt the connection to the proxy | The protocol itself is unencrypted; username and password are sent in cleartext |
Limitations
- No encryption. RFC 1929 states that the username and password travel in cleartext and does not recommend it where sniffing is possible. When you visit HTTPS sites, page content is still protected by TLS.
- UDP support depends on the provider and the client. For example, Oxylabs documents that its residential SOCKS5 supports TCP and UDP, but UDP uses a separate entry point and Google is a restricted target for UDP.
- Limited browser support. Oxylabs documentation states that Google Chrome does not support SOCKS5 proxies that require authentication; if you need a username and password, use Firefox, an HTTP client or IP allowlist authentication instead.
- Entry points and location parameters differ by provider. For example, Oxylabs SOCKS5 connections do not support country-specific entry points, so the location must be set in username parameters.
- The protocol does not change the exit IP's type, location or reputation. Whether a target site accepts the traffic depends on the exit network and request behaviour. Oxylabs also warns that some sites can identify SOCKS5 proxy traffic and suggests switching to HTTP or HTTPS on connection errors.
- The TCP connection for UDP ASSOCIATE maintains the association. UDP datagrams go to the reply’s BND.ADDR and BND.PORT and carry their own destination address and port; this does not tunnel UDP inside TCP. Closing that TCP connection terminates the association. For example, entering the original TCP proxy port in an ordinary UDP client is insufficient: the client must implement SOCKS5 UDP encapsulation. Protocol addition checked: 2026-11-20, against RFC 1928 sections 6 and 7; earlier vendor facts retain their original review date.
- Focused review 2026-11-24: RFC 1928 section 7 makes UDP fragmentation optional. FRAG 0x00 identifies a standalone datagram; a relay without fragmentation support must drop datagrams with nonzero FRAG. Hypothetical protocol example: accepting 0x00 but dropping 0x01 does not establish that all UDP is unsupported. This is not a vendor test.
Common misconceptions
- Myth: SOCKS5 is more anonymous than an HTTP proxy. In fact, anonymity depends on the exit IP and on whether the client leaks information through local DNS, WebRTC and similar paths.
- Myth: SOCKS5 encrypts traffic. In fact, the protocol only leaves room for encapsulation by methods such as GSSAPI; the common username/password authentication is cleartext.
- Myth: if a plan says it supports SOCKS5, UDP will work. In fact, UDP ASSOCIATE must be implemented by both the proxy and the client; check the provider's documentation.
- Myth: socks5h is a different protocol version. In fact, it is only a syntax used by curl and similar tools, meaning the proxy resolves the domain name.
- Myth: SOCKS5 is a type of proxy IP. In fact, it is a connection method; residential, datacenter and mobile exits may all offer SOCKS5 access.
Example
Use curl to fetch a page through a SOCKS5 proxy, with the proxy resolving the domain (the username, password and address are placeholders):
curl -x socks5h://USER:PASS@proxy.example.com:1080 https://example.com/If you change socks5h to socks5, curl resolves example.com locally first and then sends the IP to the proxy. After configuring the proxy in your browser, you can run the DNS check on this site's IP check page to see whether the actual resolver is on the proxy side.
Related terms and pages
Examples of providers offering SOCKS5 access (per their official documentation):
Sources and checks
- RFC 1928: SOCKS Protocol Version 5
- RFC 1929: Username/Password Authentication for SOCKS V5
- curl: CURLOPT_PROXY
- MDN: Proxy servers and tunneling
- MDN: Proxy-Authorization
- Chromium: Configuring a SOCKS proxy server in Chrome
- Oxylabs: Residential Proxies protocols
Date checked: 2026-11-10
This page is compiled from public standards and documentation; no hands-on test was carried out.