Skip to content

SOCKS5 Proxy Explained

Rows of blue cables plugged into a server patch panel in a data centre
A SOCKS5 proxy relays connections the way these cables carry traffic: it passes the data along without opening it up. Photo: Brett Sayles, Pexels.

A SOCKS5 proxy is a proxy server that relays your network traffic through an intermediary without reading or changing what is inside it. It works with almost any application, not just web browsers, because it forwards raw connections rather than web requests. That flexibility is the reason it exists.

The name comes from the protocol, not from a product. SOCKS5 is version 5 of the SOCKS protocol, defined in RFC 1928 in March 1996. It sits between the application layer and the transport layer, which the RFC calls a shim layer. Your app asks it to open a connection to a host and port, and the proxy passes the bytes back and forth. For the wider family of proxy types, start with our guide to the types of proxies.

Rows of blue cables plugged into a server patch panel in a data centre
A SOCKS5 proxy relays connections the way these cables carry traffic: it passes the data along without opening it up. Photo: Brett Sayles, Pexels.

What Is a SOCKS5 Proxy?

A SOCKS5 proxy is a transport-layer proxy. When your application connects to one, the proxy opens a TCP connection to the destination you named, or associates a UDP port for UDP traffic, and then relays data between you and the destination. It never parses the content, so it can carry web pages, email, file transfers, games, chat, and custom protocols alike.

That is the core difference from an HTTP proxy. An HTTP proxy understands HTTP: it reads request lines, headers, and URLs. A SOCKS5 proxy does not understand any application protocol. It only knows the destination host and port, and it moves bytes. That makes it more flexible, and also less helpful: it cannot cache pages, filter content, or rewrite headers.

SOCKS is sometimes written out as “Socket Secure”, although the original RFC does not define it as an acronym. A SOCKS proxy server is the server that runs the protocol, and a SOCKS5 proxy is one running version 5, the current version. If you need the basics first, our guide to what is a proxy server covers the foundations.

How Does a SOCKS5 Proxy Work?

A SOCKS5 session has four steps: a short handshake, then the relay.

Diagram of a SOCKS5 session: your app connects, the handshake agrees authentication, the proxy opens the connection, and the destination sees the proxy IP
The handshake is short. After it, the proxy only relays bytes. Diagram: Tech Success Communications.
  1. Greeting. Your application connects to the SOCKS5 server, conventionally on TCP port 1080, and lists the authentication methods it supports.
  2. Method selection and authentication. The server picks one method. The methods defined in RFC 1928 are no authentication, GSSAPI, and username and password. If the server accepts none of your methods, it answers with no acceptable methods and the connection closes.
  3. Request. Your application sends a request with a command and a destination: an IPv4 address, an IPv6 address, or a domain name, plus a port. The commands are CONNECT, BIND, and UDP ASSOCIATE.
  4. Reply and relay. The proxy opens the connection and answers with a reply code. From then on, data flows through unchanged, and the destination sees the proxy’s IP address, not yours.

Because the proxy relays raw bytes, the rest of the connection behaves as if your application had connected directly, apart from the changed source address. Encryption still comes from the application: HTTPS, TLS, SSH, or a VPN tunnel running through the proxy.

SOCKS5 or SOCKS5h: Who Looks Up the Address?

One detail catches people out. With socks5, your own machine resolves the destination hostname before asking the proxy to connect. With socks5h, the proxy resolves the hostname instead, so the DNS lookup does not come from your own network. The convention comes from cURL, which uses socks5h:// for proxy-side resolution and socks5:// for local resolution.

If you care about keeping DNS lookups off your local network, use the h variant:

curl --socks5-hostname user:pass@proxy.example.com:1080 https://example.com

In Python, libraries such as requests accept a socks5h:// proxy URL the same way.

SOCKS4 vs SOCKS5

SOCKS5 is an extension of SOCKS4, and the differences are practical rather than cosmetic.

SOCKS4SOCKS5
TCP supportYesYes
UDP supportNoYes, through UDP ASSOCIATE
AuthenticationNoneNo auth, username and password, GSSAPI
AddressingIPv4 onlyIPv4, IPv6, and domain names
Proxy-side DNSNo, SOCKS4a adds itYes, with the socks5h form
StandardEarly practiceRFC 1928, March 1996

SOCKS4 only handles TCP, only accepts IPv4 addresses, and has no authentication at all. Anyone who can reach a SOCKS4 server can use it. SOCKS4a, a later extension, adds domain-name addressing.

SOCKS5 adds UDP forwarding, IPv6 and domain-name addressing, and negotiated authentication. It also defines the BIND command for protocols that need an incoming connection, such as active FTP. In practice, SOCKS4 survives only in old setups. Anything new should use SOCKS5.

SOCKS5 vs HTTP Proxy

The choice between them is usually obvious once you know what traffic you need to carry.

SOCKS5 proxyHTTP proxy
LayerBetween application and transportApplication layer, HTTP only
Traffic it carriesAny TCP or UDP trafficHTTP, and HTTPS through a CONNECT tunnel
Reads the contentNo, relays raw bytesYes for plain HTTP, no for HTTPS in a tunnel
AuthenticationUsername and password, GSSAPI, or noneUsername and password in a header
Caching and filteringNoPossible for plain HTTP
DNS resolutionProxy-side with socks5hProxy-side for the CONNECT target
Typical port10808080, 3128, or provider-assigned

Use an HTTP proxy for websites and HTTP tools. It understands the traffic, it can cache and filter, and every browser and HTTP library supports it.

Close-up of Ethernet cables connected to a network switch panel in a data centre
An HTTP proxy reads web traffic. A SOCKS5 proxy only relays it. Photo: Pexels.

Our HTTP vs HTTPS proxy comparison explains the HTTP side in full, including the CONNECT tunnel that carries HTTPS.

Use SOCKS5 when the traffic is not HTTP, when the application only speaks SOCKS, or when you want the proxy to resolve hostnames for you. Games, email clients, chat apps, torrent clients, and custom TCP tools are the usual cases. For HTTPS websites the two behave almost the same.

SOCKS5 is also the protocol that SSH dynamic forwarding creates. Running ssh -D 1080 user@server opens a local SOCKS5 proxy on your own machine that forwards traffic through the SSH server. That is a useful way to get a private SOCKS proxy without a provider, if you already have a server you trust.

What Is a SOCKS5 Proxy Used For?

Non-web applications. Any application that speaks TCP or UDP can use a SOCKS5 proxy, including email clients, games, and messaging apps that have no HTTP proxy setting.

Torrents and peer-to-peer traffic. Torrent clients commonly support SOCKS5, and UDP support matters because peer discovery and some transfers use UDP. A SOCKS5 proxy does not encrypt torrent traffic, and it does not hide it from the network operator.

Gaming. Games often need UDP for low-latency play, and they rarely support HTTP proxies. A SOCKS5 proxy with UDP support fits, although whether a given provider actually supports UDP varies, so confirm it before buying.

Scraping and automation. Scrapers that need to carry non-HTTP traffic, or that want proxy-side DNS resolution, use SOCKS5 endpoints from residential or mobile pools. Our guides to residential proxies and mobile proxies explain those pools.

SSH and remote access. SOCKS5 is the standard way to forward traffic through an SSH tunnel or a bastion host to reach internal services without exposing them directly.

Bypassing network restrictions. SOCKS5 can carry traffic out through a network that only allows certain applications, because it does not depend on HTTP. This is a legitimate use on networks you manage, and it is also a reason some networks block port 1080.

Close-up of Ethernet cables connected to server ports
A SOCKS5 proxy does not care what protocol the cables carry. That is its advantage and its limit. Photo: Pexels.

Does a SOCKS5 Proxy Encrypt Your Traffic?

No. SOCKS5 does not include built-in encryption. It hides your IP address from the destination, but your internet provider, your network operator, and anyone on the path can still read unencrypted traffic.

Encryption has to come from another layer. HTTPS encrypts web traffic, TLS encrypts mail and other protocols that support it, and SSH encrypts a tunnel that a SOCKS proxy runs inside. A VPN encrypts all of a device’s traffic. If you need encryption, pair SOCKS5 with one of those, or use a VPN instead. Our proxy vs VPN guide compares the two approaches, and the forward vs reverse proxy hub explains where proxies sit in a network.

The same warning applies to authentication. Username and password authentication proves who you are to the proxy. It does not encrypt the traffic, and on an unencrypted connection the credentials themselves travel in the clear.

Setting Up a SOCKS5 Proxy

Setup is usually a matter of entering four values in your application: host, port, username, and password. The port is conventionally 1080.

In a browser. Firefox supports SOCKS5 directly in its network settings, including a remote DNS option that behaves like socks5h. Chrome relies on the operating system proxy settings or an extension.

In curl. Use --socks5-hostname for proxy-side DNS resolution, or --socks5 for local resolution:

curl --socks5-hostname user:pass@proxy.example.com:1080 https://example.com

In Python. Libraries that support SOCKS, such as requests with the requests[socks] extra, accept a socks5h:// proxy URL in the same way.

With SSH. ssh -D 1080 user@server creates a local SOCKS5 proxy on port 1080 of your own machine, forwarding through the server. This is the fastest way to get a private SOCKS proxy if you already run a server.

Checking it works. After setup, check the exit IP from the application itself, for example by loading an IP-check page through the proxy. If the page shows the proxy IP, the relay is working. Our full setup walkthrough is in how to set up a proxy server, and our guide to how to check if a proxy works covers the checking tools.

Free SOCKS5 Proxies and Free Lists

Free SOCKS5 proxy lists are widely shared, and they are a poor choice for anything serious. A free SOCKS5 server has no accountable operator, so it can log traffic, inject content, or disappear without warning. Because SOCKS5 does not encrypt traffic, a malicious operator sees every unencrypted byte.

Free lists also have a practical problem: their addresses are shared by large numbers of people, so they are usually already blocked or rate-limited. A small paid SOCKS5 endpoint from a provider you can hold accountable, or a SOCKS proxy you run yourself over SSH, is safer than any free list. If you need a provider comparison, our guide to the best proxy providers is the place to go.

SOCKS5 Proxy Security Checklist

Cables mounted into a server patch panel in a modern data centre
Confirm UDP support and authentication before you pay, not after. Photo: Pexels.
  • Confirm UDP support before buying, if you need UDP. The protocol defines it, but support is optional and varies by provider.
  • Use socks5h when DNS privacy matters, so lookups go through the proxy.
  • Do not rely on SOCKS5 for encryption. Add HTTPS, TLS, SSH, or a VPN for that.
  • Use authentication. An open SOCKS5 server with no authentication will be found and used by strangers.
  • Check the exit IP after setup, and check it again when sessions change.
  • Keep credentials out of shared files and screenshots.

Our VPN protocols compared guide covers the encryption side that SOCKS5 leaves out.

Watch: SOCKS5 Proxy Explained on Video

This short video from ProxyEmpire explains SOCKS5 and how it differs from an HTTP proxy, including the socks5 vs socks5h distinction.

SOCKS5 Proxy Explained (and SOCKS5 vs HTTP Proxies)

Frequently Asked Questions

What is a SOCKS5 proxy?

A SOCKS5 proxy is a proxy server that uses the SOCKS5 protocol, defined in RFC 1928, to relay TCP and UDP traffic without reading or changing it.

Is a SOCKS5 proxy safe?

It hides your IP address from the destination, but it does not encrypt your traffic by itself. Pair it with HTTPS, TLS, SSH, or a VPN when encryption matters, and avoid free SOCKS5 lists run by unknown operators.

What is the difference between SOCKS4 and SOCKS5?

SOCKS4 handles TCP only, IPv4 only, and has no authentication. SOCKS5 adds UDP forwarding, IPv6 and domain-name addressing, and authentication. SOCKS5 is the current version and the one to use.

What is the difference between a SOCKS5 proxy and an HTTP proxy?

An HTTP proxy understands HTTP and is built for web traffic, with caching and filtering for plain HTTP. A SOCKS5 proxy relays any TCP or UDP traffic without reading it, so it works with games, email, torrents, and other non-web applications. For HTTPS websites the two behave almost the same.

What port does SOCKS5 use?

Conventionally TCP port 1080, as stated in RFC 1928. Providers often use their own ports, so check the port in your credentials.

What does socks5h mean?

The h means the proxy resolves the destination hostname for you. With plain socks5, your own machine does the DNS lookup. With socks5h, the lookup happens through the proxy, so it does not come from your own network.

Can I use a SOCKS5 proxy for torrenting?

Yes, torrent clients commonly support SOCKS5, and UDP support is useful for peer traffic. SOCKS5 does not encrypt the traffic, and UDP support is optional, so confirm it with the provider before buying.

Do VPNs offer SOCKS5 proxies?

Some VPN services include a SOCKS5 proxy as an extra feature with a subscription. It is a proxy endpoint, not a VPN tunnel, so it does not encrypt traffic the way the VPN itself does.

Sources

10

More Proxy guides

Marcus Doyle

Written by

Marcus Doyle Proxy Writer

Marcus's byline covers proxy types and proxy provider comparisons. Comparisons use each provider's documentation, pricing pages and published network details, all linked in the article. Figures quoted from a provider are labelled as the provider's own numbers.

Umar Attique Shah

Reviewed by · November 30, 2026

Umar Attique Shah Editor & Reviewer

Umar is the editor of this site and the person responsible for what is published on it. He is an SEO consultant and WordPress developer who has built and managed content websites since 2019. After an article is published he checks it against its sources, its structure and the editorial rules on our Editorial Process page, with the help of AI-assisted checks.

How our articles are researched, reviewed and updated