SOCKS5 is a short binary handshake that turns a TCP connection into a relay to any host and port: a greeting, an optional username and password sent in clear text, then CONNECT, BIND or UDP ASSOCIATE. It adds no encryption. The difference between socks5:// and socks5h:// is only who resolves the host name, and clients disagree: curl and Python requests resolve locally with socks5://, while httpx, Go, Chrome and current Firefox send the name to the proxy either way. UDP works only when both the client and the proxy support UDP ASSOCIATE, and browsers and curl do not. Chrome and Playwright refuse SOCKS5 passwords entirely, so give them an HTTP proxy or a local forwarder.
What SOCKS5 is
SOCKS started as a firewall tool presented by David Koblas at USENIX Security in 1992; Ying-Da Lee of NEC extended it to version 4. Version 5 is RFC 1928 from March 1996, with username and password login in RFC 1929 and GSS-API in RFC 1961. There is no SOCKS6 RFC. The conventional port is 1080.
Where an HTTP proxy speaks HTTP, SOCKS5 works one level lower: it relays any TCP connection, so SSH, database clients, mail programs and games can use it, and it can relay UDP as well. It does not read or change what passes through. Our gateway answers SOCKS5 on gate.aeonproxy.com:7001 with username and password, including UDP, and HTTP on port 7000; the documentation lists the login options.
The handshake, byte by byte
Every SOCKS5 connection starts with the same short exchange. This is a CONNECT to example.com:443 with a username and password, as our gateway sees it:
client 05 02 00 02 version 5, two methods: none (00), username/password (02)
server 05 02 use username/password
client 01 0F ap_a1b2c3-cc-us 04 PASS RFC 1929: version 1, length and name, length and password
server 01 00 accepted
client 05 01 00 03 0B example.com 01 BB CONNECT (01) to a domain name (03) of 11 bytes, port 443
server 05 00 00 01 <4 bytes> <2 bytes> succeeded (00), with the address and port the proxy bound
...then the bytes of your own connection, such as a TLS handshake
The password travels in clear text, which RFC 1929 itself says makes the method unsuitable wherever sniffing is possible. The username and password are each limited to 255 bytes, which matters for providers that put targeting into the username; ours, such as ap_a1b2c3-cc-us-st-texas-sid-k1-time-1800, stays far below. And with a password, a client makes three round trips to the proxy before any data flows, against one for an HTTP proxy that sends its credentials with the CONNECT request.
Besides CONNECT there are two commands: BIND, for protocols where the server connects back to the client, FTP being the classic case, and UDP ASSOCIATE, covered below. In 18 of 18 handshakes during our tests, our gateway chose username and password (method 02).
Reply codes and what they mean
The server answers every request with one of nine codes:
| Code | RFC name | What it usually means |
|---|---|---|
00 | Succeeded | The tunnel is open |
01 | General SOCKS server failure | The exit or the upstream failed; on our gateway, anything not covered below |
02 | Connection not allowed by ruleset | A blocked target or port; on our gateway, government sites, mail ports and the default blocklist |
03 | Network unreachable | No route, for example an IPv6 target from an IPv4-only exit |
04 | Host unreachable | The name did not resolve on the proxy side, or the host is down; our gateway also uses it for upstream timeouts |
05 | Connection refused | The target port is closed |
06 | TTL expired | A routing loop or network trouble |
07 | Command not supported | The proxy does not do UDP ASSOCIATE or BIND |
08 | Address type not supported | The proxy cannot handle domain names or IPv6 |
A failed login is a different message: the RFC 1929 status byte, which curl reports as User was rejected by the SOCKS5 server (1 1). Chrome is the unhelpful one. Whatever the code, it shows ERR_SOCKS_CONNECTION_FAILED; the real value is in a network log captured at chrome://net-export, under the SOCKS_SERVER_ERROR event. IANA opened a registry for SOCKS reply codes in 2026 and assigned the first new one, 09, on 22 October 2026, for an experimental extension that passes sockets over Unix domain sockets.
socks5 or socks5h: who resolves the name
socks5h is not a different protocol. It is curl’s convention for “send the host name to the proxy” (address type 03) instead of “resolve it here and send the IP” (types 01 and 04). The trap is that socks5:// means different things in different clients:
| Client | With socks5:// | With socks5h:// |
|---|---|---|
| curl | Resolves locally | The proxy resolves |
| Python requests with PySocks | Resolves locally | The proxy resolves |
| httpx | Sends the name to the proxy anyway | Accepted since 0.28.0 |
| aiohttp-socks, httpx-socks (python-socks) | The proxy resolves by default | Rejected: “Invalid scheme component” |
| Node.js socks-proxy-agent | Resolves locally | The proxy resolves |
| undici Socks5ProxyAgent | The proxy resolves | Rejected |
| Go net/http | Treated as socks5h | Accepted since Go 1.23 |
| Chrome and Chromium | Always the proxy | No such option |
| Firefox 128 and later | The proxy, by default | No such option |
Our gateway with curl shows the difference in one line:
$ curl -v --trace-config proxy -x "socks5h://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001" https://example.com
* SOCKS5 connect to example.com:443 (remotely resolved)
$ curl -v --trace-config proxy -x "socks5://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001" https://example.com
* SOCKS5 connect to [2606:4700:10::6814:179a]:443 (locally resolved)
Local resolution costs you three things. Your own resolver sees every site you visit. Many DNS servers answer by location (RFC 7871), so a lookup made in Germany can hand a US exit the address of a German CDN node. And, as above, your machine may pick an IPv6 address the exit cannot reach. Use socks5h:// wherever the client knows the difference. Even with remote resolution, the proxy still sees the site’s name in the TLS handshake unless the connection uses Encrypted Client Hello, published as RFC 9849 in March 2026.
UDP ASSOCIATE in practice
UDP through SOCKS5 works like this: the client sends UDP ASSOCIATE on its TCP connection, the proxy replies with a relay address and port, and from then on every datagram goes to that relay with a small header naming its destination: 10 bytes for IPv4, 22 for IPv6. The association ends when the TCP connection closes, the relay drops datagrams from any other source address, and most implementations drop fragmented datagrams. It needs four things at once: a client that implements it, a proxy that allows it, a network that lets UDP through to the relay port, and a control connection that stays open.
| UDP through SOCKS5 | Tools |
|---|---|
| Not supported | Chrome, Firefox (bug open since 2023), curl, ssh -D, Tor, proxychains-ng, Go’s x/net/proxy, python-socks, undici |
| Supported | PySocks, the npm socks package, gost (udp=true on the server, relay=udp on the client), sing-box, mihomo, tun2socks, V2Ray |
Providers vary as much as clients. A 2026 benchmark by AIMultiple got “command not supported” back from two large providers that advertise UDP, and some providers send UDP and HTTP/3 through MASQUE (RFC 9298) instead.
We tested ours on 26 October 2026. UDP ASSOCIATE succeeded in 12 of 12 sticky sessions, and a DNS question to 1.1.1.1 asking which address it sees came back with the session’s TCP exit IP in 11 of 12; in the twelfth, a Deutsche Telekom household, TCP left over IPv6 and UDP over IPv4. A DNS round trip through the relay took between 76 ms and 1.3 seconds, with a median of about 270 ms, against about 5 ms without a proxy, and a second query in the same association was usually quicker than the first. Each association answered only for the first server it was used with, so open one association per destination. This test needs nothing but Python’s standard library:
import os, re, socket, struct
GATE, PORT = "gate.aeonproxy.com", 7001
USER, PASS = os.environ["AP_USER"], os.environ["AP_PASS"] # e.g. ap_a1b2c3-cc-us-sid-udp1-time-300
ctl = socket.create_connection((GATE, PORT), timeout=10) # keep it open: the association lives as long as it does
ctl.sendall(b"\x05\x01\x02") # greeting: username/password only
assert ctl.recv(2) == b"\x05\x02"
u, p = USER.encode(), PASS.encode()
ctl.sendall(b"\x01" + bytes([len(u)]) + u + bytes([len(p)]) + p)
assert ctl.recv(2) == b"\x01\x00", "login rejected"
ctl.sendall(b"\x05\x03\x00\x01" + bytes(6)) # UDP ASSOCIATE from 0.0.0.0:0
rep = ctl.recv(10) # 05 00 00 01 <relay IPv4> <relay port>
assert rep[1] == 0, f"reply code {rep[1]}"
relay = (socket.gethostbyname(GATE) if rep[4:8] == bytes(4) else socket.inet_ntoa(rep[4:8]),
struct.unpack("!H", rep[8:10])[0])
# DNS question "whoami.cloudflare TXT CH" to 1.1.1.1, behind the 10-byte SOCKS5 UDP header
query = bytes.fromhex("abcd01000001000000000000") + b"\x06whoami\x0acloudflare\x00\x00\x10\x00\x03"
udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udp.settimeout(10)
udp.sendto(b"\x00\x00\x00\x01" + socket.inet_aton("1.1.1.1") + struct.pack("!H", 53) + query, relay)
answer = udp.recv(1024)[10:]
print("1.1.1.1 sees", re.findall(rb"\d+\.\d+\.\d+\.\d+", answer)[-1].decode())
Browsers never send their UDP this way, so WebRTC and QUIC can bypass a SOCKS proxy. In Chrome the setting disable_non_proxied_udp of the WebRTC IP handling policy closes that path; antidetect browsers offer the same as a “replace with proxy IP” or “disabled” mode. Our guide to browser profiles and proxies covers that side.
Browsers and automation tools
| Tool | SOCKS5 | Username and password | UDP |
|---|---|---|---|
| Chrome, Edge and other Chromium browsers | Yes, with DNS on the proxy | No Its greeting offers only “no authentication” | No |
| Firefox | Yes, with DNS on the proxy by default since version 128 | Partly Not in its settings (a bug open since 2002), but extensions can | No |
| Playwright 1.64 | Yes | No Throws “Browser does not support socks5 proxy authentication” | No |
| Puppeteer | Through the --proxy-server flag | No page.authenticate covers HTTP proxies only | No |
| Selenium with ChromeDriver | Through socksProxy and socksVersion | No socksUsername is ignored | No |
A patch adding SOCKS5 login fields to Firefox was submitted in May 2026 and was still waiting for review in July. Until browsers change, there are two clean routes. For browser work, use our HTTP port 7000: Playwright and Puppeteer both handle HTTP proxy logins. If you need SOCKS5 specifically, run a local forwarder without a password that passes traffic on to the authenticated gateway:
# a local SOCKS5 on 127.0.0.1:1080 that forwards to the gateway with your login
gost -L socks5://127.0.0.1:1080 -F "socks5://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001?notls=true"
# Chrome through it, with local DNS lookups switched off
google-chrome --proxy-server="socks5://127.0.0.1:1080" \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE 127.0.0.1"
// Playwright without a separate binary: Apify's proxy-chain opens the local proxy for you
import { anonymizeProxy, closeAnonymizedProxy } from "proxy-chain";
const local = await anonymizeProxy("socks5://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001");
const browser = await chromium.launch({ proxy: { server: local } });
If an old guide tells you to install Proxy SwitchyOmega, it is out of date: the extension uses Manifest V2, which Chrome switched off for everyone in July 2025. ZeroOmega is the maintained fork.
Setups that work in 2026
Checked against the documentation and source of curl 8.23, requests 2.34, httpx 0.28, aiohttp-socks 0.12, socks-proxy-agent 10, undici 8 and Go 1.27 on 26 October 2026; the curl lines and the UDP test above ran through our gateway.
# curl: socks5h sends the name to the proxy
curl -x "socks5h://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001" https://api.ipify.org
curl --socks5-hostname gate.aeonproxy.com:7001 -U "ap_a1b2c3-cc-us:PASS" https://api.ipify.org
# git and most command-line tools read the same syntax
git config --global http.proxy "socks5h://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001"
export ALL_PROXY="socks5h://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001"
# Python requests: pip install "requests[socks]"
import requests
proxy = "socks5h://ap_a1b2c3-cc-de:PASS@gate.aeonproxy.com:7001"
print(requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}, timeout=30).text)
# httpx: pip install "httpx[socks]"
import httpx
with httpx.Client(proxy=proxy, timeout=30) as client:
print(client.get("https://api.ipify.org").text)
# aiohttp: pip install aiohttp-socks; socks5:// already resolves on the proxy here
import asyncio, aiohttp
from aiohttp_socks import ProxyConnector
async def main():
connector = ProxyConnector.from_url("socks5://ap_a1b2c3-cc-de:PASS@gate.aeonproxy.com:7001")
async with aiohttp.ClientSession(connector=connector) as s:
async with s.get("https://api.ipify.org") as r:
print(await r.text())
asyncio.run(main())
// Node.js: npm i socks-proxy-agent (version 10 is ESM only and needs Node 20+)
import https from "node:https";
import { SocksProxyAgent } from "socks-proxy-agent";
const agent = new SocksProxyAgent("socks5h://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001");
https.get("https://api.ipify.org", { agent }, (res) => res.pipe(process.stdout));
// fetch through undici (Socks5ProxyAgent is experimental; it rejects socks5h://)
import { fetch, Socks5ProxyAgent } from "undici";
const dispatcher = new Socks5ProxyAgent("socks5://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001");
console.log(await (await fetch("https://api.ipify.org", { dispatcher })).text());
// Go: net/http treats socks5:// like socks5h://
u, _ := url.Parse("socks5://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7001")
client := &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(u)}, Timeout: 30 * time.Second}
resp, err := client.Get("https://api.ipify.org")
// raw TCP through SOCKS5 with golang.org/x/net/proxy
dialer, _ := proxy.SOCKS5("tcp", "gate.aeonproxy.com:7001", &proxy.Auth{User: "ap_a1b2c3-cc-us", Password: "PASS"}, proxy.Direct)
conn, err := dialer.Dial("tcp", "example.com:443")
Two more tools come up constantly. ssh -D 1080 user@server turns any SSH server into a local SOCKS server, without authentication and for CONNECT only, so it carries no UDP. proxychains-ng forces SOCKS onto programs that have no proxy setting, over TCP only, and wants the first proxy as a numeric IP address in its configuration, so look up the gateway’s address first. Node’s built-in environment proxy support covers HTTP proxies only, not SOCKS.
SOCKS5, HTTP proxies, VPNs and Shadowsocks
Every option here except the VPN is set per application, while a VPN carries the whole device. Shadowsocks gives your applications a local SOCKS5 server to point at. The round trips are counted with a login, before the first byte of data.
| Encrypted to the proxy | UDP | DNS | Round trips | |
|---|---|---|---|---|
| SOCKS5 | No, and the password goes in clear text | With UDP ASSOCIATE, if both ends support it | Your choice: socks5 or socks5h | Three |
| HTTP proxy (CONNECT) | No; Basic credentials are base64, effectively clear text | No | The proxy resolves | One |
| HTTPS proxy | Yes, TLS | Through MASQUE (RFC 9298) | The proxy resolves | One, plus TLS to the proxy |
| WireGuard VPN | Yes | Yes | The VPN’s resolver | Not applicable |
| Shadowsocks | Yes | Depends on the implementation | The remote side | Not applicable |
For HTTPS traffic, SOCKS5 and an HTTP proxy are equivalent once the tunnel is open: the site sees the same exit IP and the same TLS fingerprint from your client. Choose SOCKS5 for non-HTTP protocols, for UDP, or when you want to decide where DNS is resolved, and an HTTP proxy when a browser or headless tool needs to log in. Our HTTP proxies guide covers the other side.
On speed, there is no evidence for the claim that SOCKS5 is faster as a rule, and the handshake needs more round trips. In our own timing, nine SOCKS5 requests through residential exits had a median first byte of 353 ms and thirty HTTP CONNECT requests 479 ms, but the samples were small and used different exits, so we read that as “the same order of magnitude”.
Clear-text passwords, open proxies and botnets
- Treat SOCKS5 credentials as visible to anyone between you and the proxy. Use them across networks you trust, or wrap the hop in a tunnel.
- Never expose a SOCKS server without authentication to the internet: it becomes a relay for other people’s abuse.
ssh -Dhas no authentication, so keep it bound to localhost. - Keep clients updated. CVE-2023-38545, a high-severity heap overflow in curl’s SOCKS5 code triggered by long host names with remote resolution, was fixed in curl 8.4.0 in October 2023, and curl reworked its SOCKS code again in 8.17.0 in November 2025.
- Ask where a provider’s IPs come from. 911 S5, a residential proxy botnet of about 19 million IP addresses spread through free VPN apps, was taken down in May 2024, with US Treasury sanctions and an FBI warning. In May 2025 police took down Anyproxy and 5socks, which sold hacked end-of-life routers as proxies, and in January 2026 Google disrupted IPIDEA.
- Check your own devices. The FBI’s May 2025 advice is to replace end-of-life routers, switch off remote administration and reboot.
Our gateway closes mail ports by default and answers them with reply 02, the standard way a proxy says “not allowed by ruleset”. Our comparison of proxy types has the questions to ask a provider about sourcing.
Errors, and how to test a SOCKS5 proxy
| Symptom | What you see | Fix |
|---|---|---|
| The proxy wants a login and none was sent | curl: No authentication method was acceptable. Chrome: ERR_SOCKS_CONNECTION_FAILED | Add credentials; for Chrome, use a local forwarder |
| Wrong username or password | curl: User was rejected by the SOCKS5 server (1 1). | Check both, and percent-encode special characters |
| The proxy refuses the target | curl 8.5: Can't complete SOCKS5 connection to www.usa.gov. (2) | Read the reply code in the table above |
| The proxy cannot be reached | curl exit code 7 or 5; Chrome: ERR_PROXY_CONNECTION_FAILED | Check the host, port and firewall |
| SOCKS support is not installed | requests: Missing dependencies for SOCKS support. httpx: the socksio package is not installed | pip install "requests[socks]" or "httpx[socks]" |
| socks5h:// is refused | python-socks: Invalid scheme component; undici: “Proxy URL must use socks5:// or socks:// protocol” | Use socks5://, which already resolves on the proxy in these libraries |
| Playwright with a SOCKS5 login | Browser does not support socks5 proxy authentication | Use the HTTP port, or a local forwarder |
To test a SOCKS5 proxy end to end:
- Exit IP: request
https://api.ipify.orgthroughsocks5h://and compare it with your own IP. - Who resolves DNS: add
-v --trace-config proxy(curl 8.3 or later) and look for “remotely resolved”. - Location and network: open the IP checker through the proxy.
- UDP: run the Python test above; reply code
07means the proxy does not support it. - Browser leaks: the IP checker’s WebRTC and DNS leak tests show traffic that went around the proxy.
The proxy tester checks status, speed and location for a whole list at once.
What changed in 2024–2026
| Date | Change |
|---|---|
| May 2024 | Firefox 128 starts resolving DNS on the proxy by default for SOCKS5; 911 S5 is taken down |
| Aug 2024 | Go 1.23 accepts the socks5h scheme |
| Nov 2024 | httpx 0.28.0 accepts socks5h and drops the old proxies argument |
| May 2025 | Anyproxy and 5socks are taken down; the FBI warns about hacked end-of-life routers |
| Jul 2025 | Chrome switches off Manifest V2, and with it SwitchyOmega |
| Nov 2025 | curl 8.17.0 reworks its SOCKS code |
| Jan 2026 | Google disrupts the IPIDEA residential proxy network |
| Mar 2026 | undici adds Socks5ProxyAgent; socks-proxy-agent 9 becomes ESM only; Encrypted Client Hello becomes RFC 9849 |
| May 2026 | A patch for SOCKS5 logins in Firefox’s settings is submitted |
| Sep 2026 | urllib3 2.8.0 decodes percent-encoded SOCKS credentials |
| Oct 2026 | curl 8.23.0 can refuse proxies that skip authentication; IANA assigns SOCKS method 0A and reply code 09 |
Myths, corrected
| Myth | What is true |
|---|---|
| SOCKS5 encrypts your traffic | The base protocol has no encryption, and the password goes in clear text |
| SOCKS5 is faster than an HTTP proxy | No benchmark shows it, and its handshake needs more round trips |
| socks5h is a different, safer protocol | Same protocol; only who resolves the host name differs |
| socks5:// always resolves locally | True in curl and requests; httpx, Go, Chrome and Firefox send the name to the proxy anyway |
| If SOCKS5 supports UDP, my app’s UDP goes through it | Only if the app implements UDP ASSOCIATE; browsers and curl do not |
| Chrome supports SOCKS5 with a password through an extension | Chrome’s SOCKS client offers no authentication at all |
| SOCKS5 makes you more anonymous than an HTTP proxy | The site sees the same exit IP and the same client fingerprint |
| SOCKS4 is faster | No evidence; it also lacks passwords, UDP and IPv6 |
| Install SwitchyOmega | Chrome disabled it with Manifest V2 in July 2025; use ZeroOmega |
| Ping works through SOCKS5 | SOCKS has no ICMP; it relays TCP and UDP only |
Published Oct 26, 2026. We update this guide when the platforms change; dated facts above are as of publication.