Get Started →
Engineering10 min read

SOCKS5 vs HTTP Proxies for Developers: Handshakes, DNS and Working Code

ML
Mark Lev
Network operations lead. Has been running residential SOCKS5 proxy stacks since 2019.

What actually happens on the wire

An HTTP proxy speaks HTTP itself: for plain requests it re-emits your request line; for TLS it accepts CONNECT host:443 and becomes a dumb pipe. SOCKS5 is one layer lower — a five-byte greeting, an auth exchange, a connect request carrying either an IPv4/IPv6 address or a hostname, then a transparent byte stream. Two consequences fall out of that design: SOCKS5 is protocol-agnostic (any TCP, plus UDP association), and SOCKS5 can carry the hostname to the proxy, which is where the entire DNS story lives.

DNS: the fork in the road

If your client resolves the hostname locally and sends the IP to the proxy, your resolver — your ISP, your VPN, your corporate DNS — has seen the target. Detection systems correlate exactly this. If the client sends the hostname and lets the exit resolve it, resolution happens in the exit's country with the exit's resolver, consistent with the traffic. That is the difference between socks5:// and socks5h:// and it is not cosmetic:

# Python requests — remote DNS (correct for geo-sensitive work)
proxies = {"https": "socks5h://YOUR_USER:YOUR_PASSWORD@gw.luna-proxy.com:1080"}
requests.get(url, proxies=proxies, timeout=30)

# curl — note --socks5-hostname, not --socks5
curl --socks5-hostname user:YOUR_PASSWORD@gw.luna-proxy.com:1080 https://ipinfo.io

Browser automation: the flag zoo

Chromium accepts --proxy-server=socks5://host:port but ignores inline credentials — authenticate via CDP or an extension. Playwright wraps this cleanly:

const browser = await chromium.launch({
  proxy: { server: "socks5://gw.luna-proxy.com:1080",
           username: "user", password: "pass" }
});

Node's fetch ecosystem wants an agent (socks-proxy-agent); axios takes the same agent object. HTTP proxies feel simpler in legacy stacks (HTTPS_PROXY=http://user:pass@host:port just works), which is honestly the strongest argument HTTP has left for new code.

UDP, WebRTC and the fingerprint angle

SOCKS5's UDP ASSOCIATE is what lets WebRTC, QUIC probes and STUN traffic exit through the same identity as your TCP. With an HTTP proxy, WebRTC either leaks your real address or must be disabled — and a disabled-WebRTC browser is itself a fingerprint on stricter targets. If you run antidetect profiles through LunaProxy, SOCKS5 with UDP support is the difference between a coherent identity and a contradictory one.

Engineering verdict

New code: SOCKS5 with remote DNS, credentials in the URL, one format across every tool. Existing HTTP-proxy pipelines: not worth rewriting if DNS hygiene is handled. Luna credentials work as both from the same balance, so the migration can be per-service instead of big-bang.

FAQ

Why does my proxy work in curl but not my script?

Nine times out of ten: the script uses socks5:// (local DNS) or a library that silently lacks SOCKS support. Check resolution first, library second.

Does SOCKS5 encrypt traffic?

No — neither protocol encrypts. Your TLS does. A proxy adds routing and identity, never confidentiality.