Skip to content

SOCKS5 vs HTTP proxy: which to use, and how to test each

SOCKS5 and HTTP are the two ways most tools talk to a proxy. They look alike from the outside, but they work at different levels, and the choice decides which tools, ports and checks you use. This guide explains the difference, how to pick one and how to test each from a terminal.

  • By FalconProxy
  • Reviewed
  • 5 min read
On this page
  1. 01The short version
  2. 02How an HTTP proxy works
  3. 03How SOCKS5 works
  4. 04Which to use
  5. 05Test each from a terminal
  6. 06When it fails

The short version

HTTP and SOCKS5 proxies compared
AspectHTTP proxySOCKS5 proxy
What it understandsHTTP. It reads requests, and for HTTPS it opens a tunnel with the CONNECT method.Nothing about the traffic. It opens a TCP connection to the address you name and passes the bytes through.
What it carriesWeb traffic, and any tool that has an HTTP proxy setting.Any protocol that runs over TCP: web, email, SSH and more.
Where the name lookup happensAt the proxy: your tool sends the host name.At the proxy with socks5h, on your own machine with socks5.
Sign-inA username and password in a Proxy-Authorization header (HTTP Basic), or an allowed IP address.A username and password during the handshake, or an allowed IP address.
Tool supportAlmost everywhere.Most tools. Some browsers cannot sign in to a SOCKS5 proxy with a username and password.
UDPNo.The specification allows it, but FalconProxy’s SOCKS5 endpoint carries TCP connections only.

For web traffic from a script or a browser, use the HTTP endpoint. For anything else that runs over TCP, use SOCKS5.

HTTP proxy:8080

CONNECT example.com:443

Host: example.com:443

Proxy-Authorization: ••••

200 Connection established

Plain text, line by line. The proxy reads the request and acts on it.

SOCKS5:1080

05 02 00 02greeting

05 01 00 03 0bconnect

65 78 61 6d 70 6c 65example

2e 63 6f 6d.com

01 bbport 443

Raw bytes in a short handshake. Once the proxy has connected, it passes any traffic.

The same request to example.com, as each proxy receives it: HTTP is readable text, SOCKS5 is a few bytes.

How an HTTP proxy works

For a plain http:// address, your tool sends the whole request to the proxy and the proxy forwards it. It can read everything in it.

For an https:// address, your tool first asks the proxy to open a tunnel to the website with a CONNECT request. After the proxy answers, the encrypted conversation runs straight through it. The proxy sees the host name and the port, but not the content.

http
CONNECT example.com:443 HTTP/1.1
Host: example.com:443
Proxy-Authorization: Basic <base64 of USERNAME:PASSWORD>

HTTP/1.1 200 Connection established

The behaviour of HTTP, including CONNECT and the 407 status that asks for proxy credentials, is defined in RFC 9110.

How SOCKS5 works

SOCKS5 does not read the traffic. It is a short handshake followed by a plain pipe, described in RFC 1928, with username and password sign-in in RFC 1929:

  1. Your tool lists the sign-in methods it supports.
  2. The proxy picks one: none, or a username and password.
  3. If a password is needed, your tool sends it.
  4. Your tool asks the proxy to connect to a host and port. The host can be a name or an address.
  5. The proxy answers with success or an error code, and from then on it passes the bytes in both directions.

Names, and where they are looked up

Whether the proxy or your own machine turns a host name into an address matters. With socks5:// curl looks the name up on your machine and gives the proxy an address, so the lookup leaves from your own connection. With socks5h:// curl gives the proxy the name, and the proxy looks it up. Prefer socks5h unless you have a reason not to. HTTP proxies always get the name.

Which to use

  • Browsers and browser automation. Use the HTTP endpoint, with the username and password in your tool’s own fields. Chromium cannot sign in to a SOCKS5 proxy with a username and password. The guide on proxies in Playwright, Puppeteer, Selenium, curl and Python shows each tool.
  • curl and most HTTP libraries. Either works. With SOCKS5, use socks5h.
  • Other TCP tools such as SSH, mail clients and database clients: SOCKS5.
  • Anything that needs UDP. Neither of FalconProxy’s endpoints carries it.

Test each from a terminal

Replace USERNAME and PASSWORD with the values from the proxy’s Access panel. Each command prints the address the website sees.

HTTP

shell
curl -x http://USERNAME:PASSWORD@api.falconproxy.com:8080 https://api.ipify.org

SOCKS5

shell
curl --proxy socks5h://USERNAME:PASSWORD@api.falconproxy.com:1080 https://api.ipify.org

See the handshake

Add -v and send the page to nowhere. With HTTP you will see the CONNECT request and a 200 answer. With SOCKS5 you will see these two lines, among others:

shell
curl -v --proxy socks5h://USERNAME:PASSWORD@api.falconproxy.com:1080 https://example.com -o /dev/null
output
* SOCKS5 connect to example.com:443 (remotely resolved)
* SOCKS5 request granted.

With socks5 instead of socks5h the first line shows an address and says (locally resolved): your own machine did the lookup.

If you signed in with an allowed IP address instead of a password, leave the USERNAME:PASSWORD@ part out and use the host and port that the Access panel shows in IP whitelist mode.

When it fails

Common curl results through a proxy
What you seeUsual causeWhat to do
CONNECT tunnel failed, response 407The proxy rejected the sign-in or refused the connection.Check the username, the password and the allow list, and that the proxy is switched on.
curl: (97)The SOCKS5 handshake failed. A message such as “User was rejected by the SOCKS5 server” means the sign-in was refused; otherwise the proxy could not connect onward.Make the same checks, then try the HTTP endpoint to see which side fails.
curl: (7)Your tool could not reach the proxy.Check the host and the port, and that your network allows outbound connections to them.
curl: (28)The request timed out.The phone may be offline. Open the proxy’s page and check its status.
FAQ

Questions, answered.

Not by nature. Both pass your bytes through, and the speed you get depends on the connection behind the proxy. On a phone that is the signal and the load on the network, which matter far more than the protocol.

No. Neither SOCKS5 nor an HTTP proxy encrypts what it carries. HTTPS traffic stays encrypted between your tool and the website, but the proxy itself adds no encryption.

Yes. A proxy can offer an HTTP endpoint and a SOCKS5 endpoint at once, and each tool uses the one it supports.

The HTTP endpoint, with the username and password in your tool’s own fields, or an allowed IP address with no password. Chromium cannot sign in to a SOCKS5 proxy with a username and password.

Ready to create your own proxies?

2-hour free trial, no card—pair your phone in minutes.

Already have an account? Sign in

FalconProxy