The essential points from this guide -- each one is explained in detail below.
SOCKS5 tunnels any TCP/UDP traffic, not just HTTP.
It supports authentication and IPv6 (unlike SOCKS4).
Use SOCKS5 when your application needs non-HTTP proxy support.
For standard web scraping, HTTP proxies are simpler and equally effective.
SOCKS4 only supports IPv4 and has no built-in authentication; SOCKS5 fixes both limits.
socks5h routes DNS lookups through the proxy itself, which plain socks5 does not always do.
HTTP proxies parse and understand web requests. They can modify headers, cache responses, and filter content. SOCKS5 proxies operate at the transport layer -- they create a tunnel and pass raw packets without inspecting them. This protocol-agnostic approach means SOCKS5 supports any TCP or UDP application: SSH, FTP, database connections, game clients, VoIP, and custom protocols.
SOCKS5 supports multiple authentication methods defined in RFC 1929. The most common is username/password authentication. The client sends credentials during the SOCKS handshake, before any application data flows. This is separate from HTTP proxy authentication (Proxy-Authorization header) and happens at the socket level.
Python with requests and PySocks:
import requests
proxies = {
"http": "socks5://USER:PASS@gw.knoxproxy.com:7001",
"https": "socks5://USER:PASS@gw.knoxproxy.com:7001"
}
r = requests.get("https://example.com", proxies=proxies)Node.js with socks-proxy-agent:
const { SocksProxyAgent } = require("socks-proxy-agent");
const agent = new SocksProxyAgent("socks5://USER:PASS@gw.knoxproxy.com:7001");
const res = await fetch("https://example.com", { agent });SOCKS4 is the older version of the SOCKS protocol. It only forwards TCP connections over IPv4 addresses and has no built-in authentication step, so anyone who can reach a SOCKS4 proxy server can connect without a username or password. This gap is the main reason SOCKS5 replaced SOCKS4 as the default choice across the industry.
SOCKS5 replaces SOCKS4 with three real upgrades: username and password authentication, IPv6 address support, and UDP forwarding for protocols like VoIP and some game clients. When people compare socks4 vs socks5 or ask about socks 4 vs 5, the authentication difference is usually the deciding factor -- SOCKS4 cannot lock down who connects, while SOCKS5 can.
A small number of legacy tools still default to SOCKS4 because it needs less code to implement. If your library or device only lists SOCKS4 as an option, check for a firmware or software update before assuming SOCKS5 is unavailable. Most clients built in the last ten years support SOCKS5, including PySocks, socks-proxy-agent, and most browser proxy extensions.
For proxy pool traffic, prefer dedicated or rotating SOCKS5 endpoints over SOCKS4 wherever your application allows it, since the authentication step keeps unauthorized users off your paid IPs.
The 'h' in socks5h stands for hostname, and it changes where DNS lookups happen. A plain socks5:// proxy URL resolves domain names on your own machine first, then sends only the resulting IP address through the tunnel. A socks5h:// proxy URL sends the hostname itself through the tunnel and lets the proxy server perform the DNS lookup.
This distinction matters for two reasons. First, socks5h prevents DNS leaks -- your local network never sees which domains you are visiting, since the lookup happens on the proxy side. Second, socks5h lets you reach domains that only resolve correctly from the proxy's network location, which matters for geo-targeted testing.
Most SOCKS5 client libraries accept both formats in the same proxy URL setting. In Python, PySocks and requests treat socks5h://USER:PASS@gw.knoxproxy.com:7001 the same way curl treats the --socks5-hostname flag: the hostname travels through the tunnel instead of being resolved first. If your library only lists a plain 'socks5' option with no 'h' variant, check its documentation for a separate remote-DNS setting before assuming the feature is missing.
For most scraping and browsing tasks, socks5h is the safer default since it avoids leaking any DNS queries outside the proxy tunnel. KnoxProxy's datacenter proxies include SOCKS5 support at the standard per-GB pricing starting at $0.60/GB.
Ready to put this into practice? Browse SOCKS5 Proxies
KnoxProxy Research Team · Technical Content
Network engineers and proxy infrastructure specialists with 10+ years in anti-bot systems, web scraping, and IP routing.
90.4M+ ethically sourced residential IPs across 195 countries. Instant activation, 14-day money-back guarantee.