SOCKS4 vs SOCKS5 vs HTTP proxies: protocols compared
By the ProxyOnly team · 16 Nov 2026 · 7 min read
SOCKS4, SOCKS4a, SOCKS5 and HTTP proxies compared by what the client sends, who looks up the name, how you log in and what each one can carry.
Proxy sellers list HTTP, HTTPS, SOCKS4 and SOCKS5 as if they were four flavours of one product. They are four different ways for a client to talk to a proxy, and the differences show up in where DNS lookups happen, how you log in, whether IPv6 works and what the proxy can see. Instead of taking the specifications on trust, we ran curl 8.7.1, Python requests and Chrome 157 against test proxies on our own machine and read what each client sent.
The protocol only decides how your client talks to the proxy. The address a website sees, and whether the site accepts it, depends on the address itself and its type, not on the protocol.
The short answer
- Use an HTTP proxy for web requests. Browsers, libraries and scrapers all support it, and it is the protocol our own proxies speak.
- Use SOCKS5 when the traffic is not web traffic, such as mail, chat, SSH or game connections, or when a tool only has a SOCKS setting.
- Use SOCKS4 or SOCKS4a only when old software leaves you no choice. They have no passwords, no IPv6 and no UDP.
The four protocols
- HTTP proxy. The client speaks HTTP to the proxy. For a plain
http://address it sends the full URL in the request line and the proxy forwards the request. For anhttps://address it asks the proxy to open a tunnel with the CONNECT method, described in RFC 9110, and then sends encrypted traffic through it. Logins travel in aProxy-Authorizationheader, and a refusal is a407status. - SOCKS4. A short protocol described by Ying-Da Lee in a plain text file. It defines two operations, CONNECT and BIND. The request names the destination as a four-byte IPv4 address and a port, and carries a user ID instead of a password.
- SOCKS4a. An extension that lets the client send a host name when it cannot look the name up itself.
- SOCKS5. Defined in RFC 1928 in March 1996. Client and server first negotiate an authentication method. A destination can be an IPv4 address, a host name or an IPv6 address, and the commands are CONNECT, BIND and UDP ASSOCIATE. Username and password login is in RFC 1929.
What each one sends
To see the protocols instead of reading about them, we wrote a small SOCKS server that only logs and relays, started it on our own machine and asked it for a page on port 80 of httpbin.org. Each command is followed by what the server logged.
$ curl -s --socks4 127.0.0.1:11080 -U alice: http://httpbin.org/ip
SOCKS4 request: command=1 port=80 IPv4 address=54.172.45.38 userid='alice'
$ curl -s --socks4a 127.0.0.1:11080 -U alice: http://httpbin.org/ip
SOCKS4a request: command=1 port=80 domain name='httpbin.org' userid='alice'
$ curl -s --socks5 127.0.0.1:11080 http://httpbin.org/ip
SOCKS5 greeting: client offers authentication methods [0, 1]
SOCKS5 request: command=1 address type=1 (IPv4 address) '3.221.253.123' port=80
$ curl -s --socks5-hostname 127.0.0.1:11080 http://httpbin.org/ip
SOCKS5 greeting: client offers authentication methods [0, 1]
SOCKS5 request: command=1 address type=3 (domain name) 'httpbin.org' port=80With --socks4 and --socks5 curl looked the name up on our machine and gave the proxy an address. With --socks4a and --socks5-hostname it gave the proxy the name and left the lookup to the proxy. The two addresses differ because httpbin.org has three, and the order changes between lookups.
Who looks up the name
This is the most useful difference in practice, because the lookup tells whoever runs your network which sites you visit, and the answer can depend on where the lookup happens.
- curl:
--socks4and--socks5look the name up on your machine.--socks4aand--socks5-hostnamesend the name to the proxy. As proxy URLs the same four aresocks4://,socks4a://,socks5://andsocks5h://, and-x socks4a://worked in our test. - Python requests with the
requests[socks]extra: the same four schemes gave the same four results.socks4andsocks5sent an address,socks4aandsocks5hsent the name. - Chrome 157:
socks5://sent the name to the proxy, andsocks4://looked it up locally and sent an address.
An HTTP proxy does not have this problem for plain addresses, because the request line carries the name and the proxy looks it up. Our guide to SOCKS5 and the socks5h mistake covers the setup, and DNS and WebRTC leaks covers the wider picture.
Logging in
- HTTP proxy: the client sends a
Proxy-Authorizationheader, usually Basic, with the username and password in Base64. Base64 is an encoding, not encryption. - SOCKS4: there are no passwords. The client sends a user ID, and the server may decide using the source address, destination, port, that user ID and an ident lookup, as the specification describes. Our test server logged
userid='alice'in the clear. - SOCKS5: the client lists the methods it supports and the server picks one. Without credentials curl offered
[0, 1], meaning none and GSSAPI. With credentials it added2, username and password, and the server logged the pair in the clear.
$ curl -s --socks5-hostname 127.0.0.1:11080 -U demo:s3cret http://httpbin.org/ip
SOCKS5 greeting: client offers authentication methods [0, 1, 2]
SOCKS5 username/password sent in clear: user='demo' password='s3cret' -> acceptedNone of these protects the login by itself. Unless the connection to the proxy is wrapped in TLS, anyone who can watch the path between you and the proxy can read the credentials, whichever protocol you choose. Our proxies take an http:// proxy URL, so the same applies to them, and a proxy login is best used from networks you trust.
A wrong password was refused clearly, and so was a missing one when the server demanded a login.
curl: (97) User was rejected by the SOCKS5 server (1 1).
curl: (97) No authentication method was acceptable.Browsers are the catch. We started a SOCKS5 server that insists on a login and pointed Chrome 157 at it with the credentials in the proxy address. Chrome refused with net::ERR_NO_SUPPORTED_PROXIES. Playwright, which we used to drive Chrome, refused earlier with Browser does not support socks5 proxy authentication. If you drive a Chrome-based browser through a proxy that needs a login, use an HTTP proxy.
What each one can carry
- Web traffic: all four.
- Other TCP traffic: SOCKS carries anything that runs over TCP. HTTP's CONNECT method can too, but proxies often allow it only for port 443. The sample access rules in Squid's documentation, for example, deny CONNECT to other than secure SSL ports.
- IPv6: SOCKS4 has a four-byte address field and cannot name an IPv6 address.
curl --socks4againsthttp://[::1]:9201/stopped withcurl: (97) Could not resolve host: ::1. With--socks5our server loggedaddress type=4 (IPv6 address) '::1', so SOCKS5 carried it. - UDP: SOCKS5 has a UDP ASSOCIATE command, but a service has to implement it, so check before you rely on it. HTTP's CONNECT is for TCP. Proxying UDP over HTTP is a separate standard, RFC 9298, published in August 2022, and you need to check each tool and provider for support.
What the proxy can see
We pointed curl at a test HTTP proxy, once for a plain page and once for an HTTPS one, and read the first line the proxy received each time.
GET http://127.0.0.1:9201/page HTTP/1.1
CONNECT httpbin.org:443 HTTP/1.1For plain HTTP the proxy receives the whole URL, the headers and any form data. For HTTPS it receives only the host and the port, and the page travels encrypted between you and the site. A SOCKS proxy sees the destination and relays the bytes without parsing them. If those bytes are plain HTTP the operator could read them, and if they are HTTPS they are encrypted. Our FAQ says the same of our proxies: for HTTPS sites they open a tunnel and cannot see the content.
Mixing them up
Pointing a tool at the wrong protocol or the wrong port is the commonest SOCKS mistake, and the errors do not explain themselves. With our test servers:
$ curl -sS -x http://127.0.0.1:11080 http://httpbin.org/ip
curl: (52) Empty reply from server
$ curl -sS --socks5-hostname 127.0.0.1:8104 http://httpbin.org/ip
curl: (28) Connection timed out after 10005 millisecondsThe first is an HTTP proxy setting aimed at a SOCKS port. In Python the same mistake appeared as ProxyError('Unable to connect to proxy', RemoteDisconnected('Remote end closed connection without response')). The second is a SOCKS setting aimed at an HTTP proxy, and our test proxy kept waiting for a request line that never came. Real servers behave differently, so some close the connection, some send an error page and some hang. What they share is that nothing sensible comes back. When a proxy test fails in a strange way, check the scheme and the port before anything else.
Which one to choose
- Python requests, Scrapy, curl scripts and Node.js: HTTP.
- A browser or automation tool that needs a login: HTTP.
- Mail, chat, SSH and other non-web TCP: SOCKS5.
- A tool that only offers a SOCKS setting: SOCKS5, with the name sent to the proxy.
- Old software that only speaks SOCKS4: SOCKS4a if you can, SOCKS4 if you cannot.
What ProxyOnly uses
Our proxies are HTTP proxies. Each one comes with its own host, port, username and password on the order page, and the FAQ says orders are delivered with an HTTP proxy port, so if a tool only supports SOCKS5, contact support before you order. If you are comparing offers, how to evaluate a proxy provider lists what to ask, and our setup guide for any device, browser or tool covers the HTTP side.
Try it yourself
Create an account, add funds from US$1 and order a proxy in the country you need.
Keep reading
16 Nov 2026 · Comparisons
Proxy switcher extensions: SwitchyOmega, FoxyProxy and alternatives
What happened to SwitchyOmega, the ZeroOmega fork that replaced it, FoxyProxy, what any proxy extension can see, how to pick a safe one, and setups that need no extension at all.
16 Nov 2026 · Comparisons
Playwright vs Selenium vs Puppeteer for web scraping
Playwright, Selenium and Puppeteer compared for scraping, with tests of how each handles a proxy that needs a login and what gives an automated browser away.