SOCKS5 vs HTTP Proxies: What's the Difference?

SOCKS5 vs HTTP proxies explained: CONNECT tunnels, auth, UDP, socks5 vs socks5h DNS, why neither encrypts, and which apps need which, with curl examples.

Summarize this post with AI

A 24-minute read, or the key points in about 30 seconds, in the assistant you already use.

Opens in a new tab with the prompt filled in. Nothing passes through this site.

Your proxy provider gives you two ports for the same IP. One says HTTP, the other says SOCKS5. Pick the wrong one and Chrome keeps asking for a password it will never accept, or curl quietly leaks every domain you visit to your own DNS resolver.

The usual advice is "SOCKS5 is faster and more secure". Neither part holds up.

SOCKS5 vs HTTP proxy is a choice about what your app can speak, who resolves DNS, and whether you need UDP. Encryption isn't on that list, because neither protocol encrypts anything. That's a VPN's job, and my proxy vs VPN comparison explains where one ends and the other starts.

I've gone through the specs (RFC 1928, RFC 1929, RFC 9110), curl's docs and Chromium's proxy notes. Below: what each one does, a side-by-side table, copyable curl commands and a simple rule for picking the port.

Editorial cover showing an HTTP proxy tunnel and a SOCKS5 proxy tunnel carrying traffic from a laptop to the internet

What is the difference between SOCKS5 and HTTP proxies?

The short answer: an HTTP proxy speaks HTTP and understands web requests. A SOCKS5 proxy doesn't care what you send. It opens a connection to a host and port for you and relays the bytes.

That one difference explains almost everything else in this post.

An HTTP proxy reads your request. For a plain http:// page, the client sends the full URL to the proxy, like GET http://example.org/page HTTP/1.1, and the proxy fetches it. RFC 9112 calls this the absolute-form. Because the proxy understands the request, it can cache it, filter it, add headers or block it.

A SOCKS5 proxy works one level lower. RFC 1928 describes it as a "shim-layer" between the application layer and the transport layer. Your app tells the proxy "connect me to this host on this port", and after that the proxy only moves data. It could be a web page, an email session, a database connection or a game.

Diagram of network layers showing an HTTP proxy at the application layer and a SOCKS5 proxy at the session layer above transport
An HTTP proxy understands web requests. SOCKS5 sits below the app and relays whatever the app sends.

SOCKS5 vs HTTP proxy: side-by-side comparison

Here's the whole comparison in one table. Every row comes from the RFCs and client docs linked in this post.

HTTP proxySOCKS5 proxy
Where it worksApplication layer, understands HTTPBetween the app and transport layer, protocol-agnostic
Traffic it carriesHTTP directly, HTTPS and other TCP through CONNECTAny TCP, plus UDP through UDP ASSOCIATE if both sides support it
HTTPS websitesCONNECT tunnel, then TLS end to endRelays the TCP connection, TLS end to end
AuthenticationProxy-Authorization header, usually BasicUsername and password (RFC 1929) or GSSAPI
Encryption by itselfNoneNone
DNS resolutionThe proxy resolves the hostnameYour choice: socks5 resolves locally, socks5h at the proxy
Can see or change requestsYes for plain http://, no inside a CONNECT tunnelNo, it only relays bytes
Adds headersThe spec requires a Via header on forwarded HTTPNo headers, it doesn't speak HTTP
Default portNo fixed standard (Chrome assumes 80, curl 1080)1080 by convention
Chrome supportYes, with Basic, Digest, NTLM or Negotiate authYes, but no authentication at all
Good fitBrowsers, APIs, scrapers, n8nTelegram, SSH tunnels, custom TCP apps, UDP

Two rows in that table cause most of the trouble people run into: authentication in Chrome, and DNS. I'll get to both.

How does an HTTP proxy handle HTTPS? (the CONNECT tunnel)

For HTTPS, an HTTP proxy doesn't read your traffic. It builds a tunnel.

The client sends a CONNECT request with only a host and port, such as CONNECT example.com:443 HTTP/1.1. RFC 9110 says that once the proxy answers with any 2xx status, it switches to "blind forwarding of data, in both directions" until the tunnel closes. Your browser then runs TLS through that tunnel straight to the website.

So the proxy sees the hostname and port. It doesn't see the page, the cookies or the form you submit. As curl's own guide puts it, the proxy "cannot see nor modify the traffic without breaking the encryption".

Two catches matter here:

  • The hostname in the CONNECT line travels to the proxy in the clear. Chromium's proxy docs say this directly.
  • Most HTTP proxies only allow CONNECT to port 443 and a few others. RFC 9110 tells proxies to restrict it, because an open CONNECT to port 25 could be used to relay spam.

That second point matters if you want to push something other than HTTPS through an HTTP proxy, like SSH or IMAP. The CONNECT mechanism can carry any TCP stream, but your provider decides which ports it allows. SOCKS5 has no such convention, so it's the easier choice for non-web TCP.

This sounds good on paper, but what about plain http:// pages? Those go to the proxy unencrypted, and the proxy can read and modify them. That's true of SOCKS5 too. If the site itself isn't on HTTPS, no proxy protocol fixes that.

How does a SOCKS5 connection work?

A SOCKS5 connection starts with a short handshake before any of your data moves. RFC 1928 defines three steps.

Diagram of the SOCKS5 handshake between a client, a SOCKS5 proxy and a target server with greeting, auth and connect steps
Greeting, auth, connect. After the proxy replies with success, it relays bytes without looking at them.

Greeting. The client opens a TCP connection to the proxy (port 1080 by convention) and lists the authentication methods it supports. The proxy picks one, or replies that none are acceptable and the client must hang up.

Auth. If the proxy picked username and password, the client sends both (RFC 1929). A status of success lets it continue. Anything else, and the server must close the connection.

Connect. The client sends a request with a command and a destination. There are three commands: CONNECT for a normal TCP connection, BIND for protocols where the server connects back to the client (RFC 1928's example is FTP), and UDP ASSOCIATE for UDP. The destination can be an IPv4 address, an IPv6 address or a domain name.

That last detail is the reason socks5h exists. If the client sends a domain name, the proxy resolves it. If the client resolves it first and sends an IP, your own DNS server saw the lookup.

socks5 vs socks5h: where does DNS get resolved?

This is the one letter that causes the most leaks.

curl's documentation spells it out. With socks5:// (or --socks5), curl resolves the hostname on your machine and sends the proxy an IP. With socks5h:// (or --socks5-hostname), curl sends the hostname and the proxy resolves it. Python Requests follows the same convention and says so in its docs.

Why care? If your machine resolves the name, your ISP or local DNS resolver sees every domain you visit, even though the website sees the proxy's IP. For scraping that's mostly harmless. For anything where you don't want your local network to see where you go, it defeats the point.

HTTP proxies don't have this switch. The client sends the hostname in the URL or the CONNECT line, and the proxy resolves it. Chromium's docs confirm Chrome always defers name resolution to an HTTP proxy, and with SOCKS5 it also always resolves at the proxy side. Firefox lets you choose, through the network.proxy.socks_remote_dns setting.

My take: use socks5h every time you have the choice. There's rarely a good reason to resolve locally when you're already paying for a proxy. If you want to confirm it's working, my guide on how to test a proxy for DNS and WebRTC leaks has a terminal-only DNS check.

Do SOCKS5 or HTTP proxies encrypt your traffic?

No. Neither one does, and this is the myth worth killing.

Look at how each sends your password:

  • HTTP proxies usually use Basic authentication. RFC 7617 says Basic only Base64-encodes user-id:password and calls it "not a secure method of user authentication" without TLS. Base64 is an encoding, not encryption. Anyone on the path can reverse it.
  • SOCKS5 username and password auth is no better. RFC 1929's security section says the request "carries the password in cleartext" and isn't recommended where sniffing is possible.

What protects your data is TLS between your app and the website, which happens the same way through both. A proxy that "supports HTTPS" means it supports the CONNECT tunnel, not that it encrypts anything itself.

There is a real encrypted option: an HTTPS proxy, where your client talks TLS to the proxy itself. curl supports it with an https:// proxy scheme, and Chromium's docs say this keeps the CONNECT hostname hidden, and your credentials travel inside TLS too. The catch is that many providers label a plain HTTP proxy with CONNECT support as "HTTP(S)". Ask which one you're getting.

Which is faster, SOCKS5 or HTTP?

Neither is faster in any way you can rely on. I haven't benchmarked them for this post, and I'd be suspicious of anyone who quotes a universal winner.

Here's what the protocols do on each new connection:

  • SOCKS5 needs a greeting, an optional auth exchange and a connect request before your data flows. That's a few extra round trips to the proxy per connection.
  • An HTTP proxy with plain http:// sends the request straight away. For HTTPS, it sends one CONNECT request and waits for the reply before TLS starts. If the client doesn't send credentials up front, a 407 challenge adds another round trip.

Once the tunnel is up, both only move bytes. From then on, speed depends on the proxy server, how far it is from you and the target, and how loaded its network is. A proxy in the wrong country costs you far more than any handshake.

One real difference does show up in Chromium's docs. Chrome caps HTTP/1.1 proxies at 32 simultaneous connections across all sites. HTTPS proxies using HTTP/2 avoid that limit. That matters for heavy browser automation, not for normal browsing.

Which apps need SOCKS5 and which need an HTTP proxy?

In practice, your app usually makes this decision for you. Here's what the official docs say for the tools people ask about most.

App or toolHTTP proxySOCKS5Note
ChromeYes, with authYes, without authChrome supports no SOCKS5 authentication
FirefoxYesYesRemote DNS for SOCKS is a setting
curlYes (default)YesUse socks5h:// for remote DNS
Python RequestsYesYes, with requests[socks]socks5h:// for remote DNS
n8n HTTP Request nodeYesNot documentedThe Proxy option asks for an HTTP proxy
TelegramSome appsYesAlso supports MTProto proxies
UDP apps (games, calls, some torrent clients)NoOnly if UDP ASSOCIATE worksCheck the provider supports UDP

Browsers

The surprise is Chrome. Chromium's proxy documentation says plainly: "No authentication methods are supported for SOCKSv5 in Chrome". If your provider gives you a SOCKS5 proxy with a username and password, Chrome can't use it directly. Use the HTTP port with the same credentials, whitelist your IP with the provider, or put a local SOCKS client in between.

Chrome also uses SOCKS5 only for TCP page requests. It can't relay UDP through it.

curl, scrapers and scripts

For web scraping, an HTTP proxy is the simpler default. Every HTTP library supports it, auth is built in, and HTTPS goes through CONNECT without extra setup. Choose SOCKS5 when the provider only offers it, or when you need non-HTTP traffic from the same script. Your choice of protocol is separate from the IP type: residential proxies and datacenter proxies often come with both HTTP and SOCKS5 ports.

n8n and automation tools

The n8n HTTP Request node has a Proxy option, and n8n's docs describe it as the place to "specify an HTTP proxy". Stick with HTTP there. My guide to proxies for n8n workflows covers which proxy types fit which jobs.

Telegram

Telegram's own proxy page says its apps generally support two types: SOCKS5 (server, port and an optional username and password) and MTProto. Some apps also support HTTP proxies. If you're only routing Telegram, MTProto is usually the better pick, and I compared both in my post on Telegram proxies.

Games, voice calls and torrents

These lean on UDP, and that's the one job an HTTP proxy can't do in the classic setup. SOCKS5 can, through UDP ASSOCIATE. But RFC 1928 lets the relay silently drop datagrams it won't forward, and RFC 8828 (the WebRTC IP handling spec) notes that most SOCKS proxies don't support UDP at all. Check that both your app and your provider support it before you buy.

There is a newer standard, RFC 9298 (2022), that lets HTTP proxies carry UDP the way CONNECT carries TCP. Good to know, but treat provider support for it as something to ask about, not assume.

How do you use each one with curl?

These commands are straight from curl's documentation, with placeholder hosts. Replace USER, PASS, the host and the port with your provider's details.

bash
# HTTP proxy (plain http:// target goes through as a normal request)
curl -x http://USER:PASS@proxy.example.com:8080 http://example.com/

# HTTP proxy with an https:// target (curl uses CONNECT automatically)
curl -x http://proxy.example.com:8080 -U USER:PASS https://example.com/

# SOCKS5, DNS resolved on YOUR machine
curl -x socks5://USER:PASS@proxy.example.com:1080 https://example.com/

# SOCKS5, DNS resolved by the PROXY (use this one)
curl -x socks5h://USER:PASS@proxy.example.com:1080 https://example.com/
curl --socks5-hostname proxy.example.com:1080 --proxy-user USER:PASS https://example.com/

# Same proxy for every curl call in this shell
export ALL_PROXY="socks5h://USER:PASS@proxy.example.com:1080"

Three mistakes that break these commands:

  • Leaving out the port. curl's man page says a proxy without a port is assumed to be on 1080, even for HTTP proxies. If your HTTP proxy listens on 8080, say so.
  • Pointing http:// at a SOCKS port. With no scheme, or http://, curl treats the proxy as HTTP. A SOCKS port needs socks5:// or socks5h:// in front.
  • Special characters in the password. curl URL-decodes credentials in the proxy string, so an @ in the password must be written as %40.

For Python Requests, the same rules apply. Install the extra with pip install "requests[socks]", then pass socks5h:// URLs:

python
import requests

proxies = {
    "http": "socks5h://USER:PASS@proxy.example.com:1080",
    "https": "socks5h://USER:PASS@proxy.example.com:1080",
}
print(requests.get("https://example.com/", proxies=proxies, timeout=20).status_code)

SOCKS5 or HTTP proxy: which should you use?

Decision diagram for choosing a proxy: only web traffic leads to an HTTP proxy, anything else leads to a SOCKS5 proxy
Start with one question: is it only web traffic? Then check what your app supports.

Ask one question first: is it only web traffic?

Pick an HTTP proxy if:

  • You're browsing, scraping or calling APIs over HTTP and HTTPS.
  • You use Chrome with a username and password.
  • The tool only asks for an HTTP proxy, like n8n's HTTP Request node.

Pick SOCKS5 if:

  • The app isn't a web client: Telegram, an SSH tunnel, an email client, a database tool or a custom TCP app.
  • You need UDP, and your provider confirms UDP ASSOCIATE support.
  • You want explicit control over DNS, using socks5h.

Skip the protocol debate if your real need is encryption or hiding all of your device's traffic. Neither protocol does that. A VPN does.

Many proxy plans list both HTTP and SOCKS5 support, so this often changes which port you type in, not what you buy. The IP type and the session type (rotating vs sticky) matter far more to whether your target lets you in.

Frequently asked questions

Is SOCKS5 more secure than an HTTP proxy?▾
Not by itself. Neither protocol encrypts your traffic, and both send proxy credentials without encryption. Security comes from TLS to the website, an HTTPS proxy endpoint, or a VPN on top.
Is SOCKS5 faster than HTTP?▾
There's no reliable rule. SOCKS5 adds a short handshake on each new connection, and HTTPS through an HTTP proxy adds a CONNECT exchange. After that, speed depends on the proxy's server, location and network, not the protocol.
What is the difference between socks5 and socks5h?▾
With socks5, your machine resolves the hostname and sends the proxy an IP, so your local DNS resolver sees every domain. With socks5h, the proxy resolves the name. Use socks5h unless you have a reason not to.
Why won't Chrome accept my SOCKS5 username and password?▾
Chrome doesn't support any authentication for SOCKS5 proxies, according to Chromium's own proxy docs. Use the provider's HTTP port with the same credentials, or whitelist your IP address so no password is needed.
Can an HTTP proxy handle HTTPS sites?▾
Yes. The client sends a CONNECT request, the proxy opens a tunnel to port 443, and TLS runs end to end through it. The proxy sees the hostname but not the page content.
Does SOCKS5 support UDP for gaming or calls?▾
The protocol does, through the UDP ASSOCIATE command in RFC 1928. RFC 8828 notes most SOCKS proxies don't support UDP, so confirm it with your provider and your app before you rely on it.
Which proxy type is better for web scraping?▾
An HTTP proxy is usually the simpler choice, because every HTTP library supports it and HTTPS works through CONNECT. SOCKS5 works too, as long as you use socks5h for DNS. The IP type matters more than the protocol.

If you're choosing a provider next, look at the IP pool, the session options and the price per GB before the protocol list. Most of the providers I've compared list both HTTP and SOCKS5, and the comparison shows which ones are worth paying for.

Share