Regional Preferences

Language

Nothing in the list matches what you typed there.

Tutorials · 2026-06-13 · Updated

SOCKS4 vs SOCKS5 in plain English: which do you need?

SOCKS4 and SOCKS5 sound almost identical, but only one handles logins, UDP traffic and remote DNS. The difference without jargon, and how to use SOCKS5.

In plain English: a protocol is an agreed set of rules for how two programs talk to each other. SOCKS is a protocol for proxies. It passes your data along without reading it, which means it can carry far more than web pages: games, email, chat apps and other programs too. There are two versions you'll come across, SOCKS4 and SOCKS5. The names suggest a small update, but the gap between them affects what you can actually do. If you're in a hurry, here's the short answer: pick SOCKS5. The rest of this guide explains why, and shows how to use it.

Quick start in 3 steps

  1. Set your proxy to SOCKS5. All of our plans include it.
  2. In code, use the socks5h form of the address so website names are looked up by the proxy (explained below).
  3. Test the result with the proxy checker and the DNS leak test.

How SOCKS differs from an ordinary web proxy

An HTTP proxy understands web requests and is made for web traffic, meaning HTTP and HTTPS. A SOCKS proxy works at a lower level. It relays a basic network connection, the kind called TCP, and with SOCKS5 a UDP one as well. UDP is a faster, looser kind of connection used by things like voice calls and games. Because of this, SOCKS can carry traffic that an HTTP proxy can't easily handle, such as email, game connections, peer-to-peer apps and all sorts of other services. The trade-off: SOCKS doesn't look inside or store web content. It just moves the data along.

SOCKS4: the older, simpler version

SOCKS4 came first, and it shows. Here's what defines it:

  • TCP only. It can't carry UDP traffic at all.
  • No proper login. SOCKS4 has no standard username-and-password option, so access is usually controlled by an IP allowlist, a list of addresses the proxy agrees to serve.
  • IPv4 only, as designed. The original version deals only in IPv4 addresses and leaves your own device to look up website names.

A later add-on called SOCKS4a let the proxy look up website names itself, but it still has no UDP and no login. SOCKS4 copes in simple, controlled setups. For most of today's tasks it feels dated.

SOCKS5: the current standard

SOCKS5 is the one to use now. It keeps everything good about SOCKS and fills the gaps:

  • TCP and UDP. UDP support means streaming, voice, games and UDP-based DNS can all go through the proxy.
  • Logins. It supports a username and password, so access can be protected by a login rather than by an address list alone.
  • Remote DNS. The proxy can look up website names for you, so your own internet provider doesn't see a list of the sites you visit.
  • IPv4 and IPv6. It can reach websites using either kind of address.

Remote DNS matters more than it first appears. DNS is the step where a name like example.com gets turned into a server's number. If your device does that step itself, your provider sees every website name you look up, even though the connection itself goes through the proxy. SOCKS5 hands that step to the proxy and closes the gap. You can see whether your own setup leaks with our DNS leak test.

The two side by side

FeatureSOCKS4SOCKS5
Kinds of trafficTCP onlyTCP and UDP
Login optionsNone (access by IP address)None, GSSAPI, or username and password
Website name look-upsOn your device (SOCKS4a adds lookup by the proxy)Can be done by the proxy
Address typesIPv4IPv4 and IPv6
When to use itOlder software or simple internal setupsNearly everything today

Neither one encrypts your traffic

Many people believe SOCKS5 encrypts what you send. It doesn't, and neither does SOCKS4. Both simply pass data along. Any encryption comes from whatever runs on top of them, such as HTTPS, which protects the conversation with a website, or an SSH tunnel. When privacy of the content matters, make sure the thing you send through the proxy is encrypted itself. Don't expect the SOCKS layer to do it for you.

Using SOCKS5 in Python

The requests library understands SOCKS5 once you add its SOCKS extra with pip install requests[socks]. Then write the proxy address with the socks5h prefix. The h at the end tells it to let the proxy look up website names, which is the safer choice:

import requests

proxies = {
    "http": "socks5h://USER:PASS@HOST:PORT",
    "https": "socks5h://USER:PASS@HOST:PORT",
}

r = requests.get("https://httpbin.org/ip", proxies=proxies, timeout=20)
print(r.json())

For comparison, an ordinary HTTP proxy in the same library is written http://USER:PASS@HOST:PORT. Only the start of the address changes.

Using SOCKS5 in Node.js

In JavaScript, the axios library can use a SOCKS agent, a small helper that sends its connections through the proxy. Install both packages with npm first, then:

const axios = require("axios");
const { SocksProxyAgent } = require("socks-proxy-agent");

const agent = new SocksProxyAgent("socks5://USER:PASS@HOST:PORT");

axios.get("https://httpbin.org/ip", { httpAgent: agent, httpsAgent: agent })
  .then((res) => console.log(res.data))
  .catch((err) => console.error(err.message));

Which one should I choose?

SOCKS5 is the right pick for nearly any job you'll meet. It does more, it supports logins so you aren't tied to an IP allowlist, and it can keep your DNS look-ups private. SOCKS4 only makes sense when you're connecting old software that knows nothing newer. And if your program only ever deals with websites, an ordinary HTTP or HTTPS proxy works perfectly well and is often simpler. SOCKS earns its place once you need to move traffic that isn't web pages.

Every Budget Proxies plan comes with SOCKS5 as well as HTTP and HTTPS, so you can choose whichever your app expects. The proxy type matters as much as the protocol. For lots of requests where speed counts, start with datacenter proxies. For traffic that should come from an ordinary home or phone connection, look at residential or mobile proxies, and keep residential premium for the few sites that refuse standard residential addresses. Once you're set up, run the proxy checker to confirm the connection and the exit address are what you expect.

Beginner questions

Is SOCKS5 safer than HTTPS?

They do different jobs. HTTPS encrypts your conversation with a website. SOCKS5 decides which route your traffic takes and doesn't encrypt anything. For privacy you usually want both: HTTPS websites, reached through a SOCKS5 proxy.

Can I use SOCKS5 in my web browser?

Usually, yes. Firefox has a SOCKS option in its own network settings, and most other browsers use your computer's proxy settings. One snag: browsers often can't send a username and password to a SOCKS5 proxy. For browser use, an IP whitelist login or the HTTP/HTTPS option tends to be easier.

Is it legal to use a SOCKS5 proxy?

In most places, yes. A SOCKS5 proxy is a standard networking tool, and the usual rules apply: the services you reach through it keep their own terms, and the law where you live still counts.

Will SOCKS5 make my connection faster?

Not by itself. Speed depends mostly on the proxy's location and type and on your own connection. SOCKS5 adds very little overhead because it doesn't inspect your data.

In short: SOCKS4 is an older version you'll bump into now and then, and SOCKS5 is the sensible choice for modern work, thanks to UDP, logins and remote DNS. Pick SOCKS5, send encrypted traffic through it, and check the setup before you rely on it.

Keep reading

Ready to try one yourself?

Start small: buy a little data in the type that suits your task, check it with our free tools, and top up only if you need more. There’s no contract and no minimum spend.

View our proxies

New to proxies? Start with a small order

Datacenter proxies cost $2.49 per gigabyte (GB) of data you use, so trying one on the site you care about needn’t cost much. Your login details are ready within seconds, and if you get stuck, a real person answers questions 24/7.

Budget Proxies logo

or
Continue with Email

Continue and you're agreeing to our Terms and Privacy Policy.

Already set up with us?

First time with us?

🎉 Money-off code

Knock 10% off
your next order

Type your email below and we’ll send the code over. It works on any proxy plan, however small the order. At checkout, paste it into the Promo code box and press Apply.

You’ll get the code and, now and then, an offer by email. Changed your mind later? Ask us and we’ll take you off the list.

Sorted! It’s on its way 📬

Your 10% code is heading to your inbox. No need to wait for the email, though: copy it from here and paste it in when you check out.

See residential plans →