SOCKS5 is a versatile proxy protocol that handles any type of internet traffic at the transport layer. While HTTP proxies are designed specifically for web traffic, SOCKS5 operates at a lower level of the network stack, making it capable of forwarding TCP and UDP packets for virtually any application — web browsing, email, file transfers, gaming, streaming, and custom protocols. Understanding how SOCKS5 works and when to use it will help you choose the right proxy protocol for your needs.

What Is the SOCKS Protocol?
SOCKS (Socket Secure) is a network protocol that routes network packets between a client and a server through a proxy server. The protocol was originally developed in the early 1990s and has evolved through several versions:
- SOCKS4 (1996) — The first widely adopted version. Supports TCP connections only. No authentication mechanism. No UDP support. No IPv6 support.
- SOCKS4a — An extension of SOCKS4 that adds support for DNS resolution through the proxy, so the client does not need to resolve hostnames locally.
- SOCKS5 (1996, RFC 1928) — The current standard. Adds UDP support, multiple authentication methods, IPv6 support, and domain name resolution through the proxy.
SOCKS5 is the version used by virtually all modern proxy services and applications. When someone says "SOCKS proxy" today, they almost always mean SOCKS5.
How SOCKS5 Works: The Technical Details
A SOCKS5 connection follows a three-phase handshake:
Phase 1: Greeting and Authentication Negotiation
The client connects to the SOCKS5 proxy server and sends a greeting that lists the authentication methods it supports. Common methods include:
- 0x00 — No authentication required
- 0x02 — Username/password authentication (most common for commercial proxies)
The proxy server responds with the chosen authentication method.
Phase 2: Authentication
If username/password authentication is selected, the client sends its credentials. The proxy validates them and responds with a success or failure status.
Phase 3: Connection Request
The client sends a connection request specifying: - The command type (CONNECT for TCP, UDP ASSOCIATE for UDP) - The destination address (IPv4, IPv6, or domain name) - The destination port
The proxy establishes the connection to the target and begins relaying data bidirectionally. From this point on, the proxy is transparent — it simply forwards packets without inspecting or modifying them.
How SOCKS5 Differs from HTTP Proxies
HTTP proxies interpret and modify HTTP headers, while SOCKS5 simply forwards packets without inspecting content. This fundamental difference has practical implications:

| Aspect | SOCKS5 | HTTP Proxy |
|---|---|---|
| Layer | Transport (Layer 5) | Application (Layer 7) |
| Protocol Support | Any (TCP + UDP) | HTTP/HTTPS only |
| Header Handling | Passes through unchanged | May add X-Forwarded-For, Via |
| HTTPS | Tunnels encrypted traffic as-is | Can intercept (MITM) or tunnel (CONNECT) |
| DNS Resolution | Optionally through proxy | Usually local |
| Performance | Slightly faster (no parsing) | Slightly slower (parses headers) |
| Detection Risk | Lower | Higher (header leaks possible) |
| Setup Complexity | Requires SOCKS library | Native support in most tools |
The key takeaway: SOCKS5 is more versatile and stealthier, while HTTP proxies are more convenient for standard web browsing and scraping.
SOCKS4 vs SOCKS5: What Changed?
If you encounter both options, here is why SOCKS5 is always the better choice:
| Feature | SOCKS4 | SOCKS5 |
|---|---|---|
| TCP Support | Yes | Yes |
| UDP Support | No | Yes |
| Authentication | None | Username/password + extensible |
| IPv6 | No | Yes |
| Domain Resolution | SOCKS4a only | Built-in |
| Security | Minimal | Stronger with auth |
SOCKS4 is a legacy protocol. There is no modern reason to use it over SOCKS5 unless you are working with extremely old software that only supports SOCKS4.
Key Advantages of SOCKS5

Protocol Agnostic
SOCKS5 works with any protocol that runs over TCP or UDP. This includes:
- HTTP/HTTPS — Standard web traffic
- FTP — File transfers
- SMTP/IMAP — Email
- SSH — Secure shell connections
- DNS — Domain name resolution
- Custom protocols — Any application that uses TCP or UDP sockets
UDP Support
SOCKS5's UDP support is critical for:
- DNS resolution — Resolving domain names through the proxy prevents DNS leaks that reveal your browsing targets
- VoIP and video — Real-time communication protocols that use UDP
- Gaming — Online games that use UDP for low-latency communication
- Streaming — Some streaming protocols use UDP for performance
No Data Modification
HTTP proxies can (and often do) modify your traffic — adding proxy headers, rewriting URLs, or even injecting content. SOCKS5 never touches your data. It relays packets byte-for-byte, which means:
- No risk of proxy-identifying headers being added
- No risk of SSL/TLS interception
- No risk of content modification
- Better privacy and security
Authentication Support
SOCKS5 supports username/password authentication out of the box, and the protocol is extensible to support other methods like GSSAPI. This means proxy providers can securely authenticate users without relying on IP whitelisting.
Common Use Cases for SOCKS5
Web Scraping — SOCKS5 is increasingly preferred for scraping because it does not add detectable proxy headers. See our SOCKS5 scraping tutorial for code examples.
P2P and Torrenting — BitTorrent clients support SOCKS5 natively, allowing you to route torrent traffic through a proxy for privacy.
Email Operations — Route SMTP/IMAP connections through SOCKS5 to manage email accounts from different IP addresses.
Gaming — Reduce latency to specific game servers or access region-locked gaming content.
General Privacy — Route all your internet traffic through SOCKS5 at the OS level for comprehensive IP masking.
Bypassing Firewalls — SOCKS5 can tunnel any protocol through a single port, making it useful for accessing services blocked by corporate or government firewalls.
How to Set Up SOCKS5 Proxies
Browser Configuration
Most browsers support SOCKS5 proxy configuration:
- Firefox: Settings > Network Settings > Manual proxy configuration > SOCKS Host
- Chrome: Uses system proxy settings, or launch with
--proxy-server=socks5://host:port
Command Line (curl)
`bash
curl --socks5 user:pass@gate.resproxy.io:7000 https://httpbin.org/ip
`
Use --socks5-hostname to resolve DNS through the proxy (prevents DNS leaks).
Python
`python
import requests
proxies = {
"http": "socks5h://user:pass@gate.resproxy.io:7000",
"https": "socks5h://user:pass@gate.resproxy.io:7000",
}
response = requests.get("https://httpbin.org/ip", proxies=proxies)
print(response.json())
`
Note: You need pip install requests[socks] for SOCKS support in the requests library.
System-Wide (Linux/macOS)
Use tsocks or proxychains to route all system traffic through SOCKS5:
`bash
# Install proxychains
# Configure /etc/proxychains.conf with your SOCKS5 proxy
proxychains curl https://httpbin.org/ip
`
SOCKS5 vs VPN: What Is the Difference?
People often confuse SOCKS5 proxies with VPNs. The key differences:
- Encryption: VPNs encrypt all traffic. SOCKS5 does not add encryption (though your application's own encryption, like HTTPS, still works).
- Scope: VPNs route all system traffic. SOCKS5 is configured per-application.
- Speed: SOCKS5 is faster because it does not add encryption overhead.
- Flexibility: SOCKS5 lets you use different proxies for different applications simultaneously.
For most proxy use cases (scraping, account management, data collection), SOCKS5 is the better choice because of its speed and per-application flexibility.
Choosing a SOCKS5 Proxy Provider
When evaluating SOCKS5 proxy providers, look for:
- Residential IPs — SOCKS5 with datacenter IPs is still detectable by IP reputation. Residential SOCKS5 gives you both protocol stealth and IP legitimacy.
- Authentication support — Username/password auth is more flexible than IP whitelisting.
- Rotation options — Both rotating and sticky sessions for different use cases.
- Global coverage — IPs in the countries you need to target.
All ResProxy plans support SOCKS5 alongside HTTP/HTTPS — see our rotating proxy pricing or IPv4 pricing. Visit our getting started guide to set up your SOCKS5 proxy in minutes.
For a hands-on tutorial, read web scraping with SOCKS5 proxies. The full protocol specification is available at IETF RFC 1928.
FAQ
Is SOCKS5 more secure than HTTP proxies?
SOCKS5 itself does not encrypt traffic, so it is not "more secure" in terms of encryption. However, it is more private because it does not add proxy-identifying headers and does not inspect or modify your data. For encryption, rely on HTTPS (TLS) at the application layer.
Can I use SOCKS5 for streaming Netflix or other services?
Technically yes — SOCKS5 can tunnel any TCP traffic. However, streaming services actively detect and block known proxy IPs regardless of protocol. Residential SOCKS5 proxies have the best chance of working because the IPs are not flagged as proxies.
Why do some tools not support SOCKS5?
SOCKS5 requires a separate library at the socket level, while HTTP proxies work through standard HTTP mechanisms that every HTTP library supports natively. Support is growing, though — most modern tools now offer SOCKS5 compatibility through plugins or built-in options.
What port does SOCKS5 use?
The conventional default port for SOCKS5 is 1080, but proxy providers often use custom ports. ResProxy uses port 7000 for both HTTP and SOCKS5 protocols. Always check your provider's documentation for the correct port.
Founder & CEO
Founder of ResProxy and JC Media Agency. Over 5 years of experience in proxy infrastructure, digital advertising, and SaaS product development. Building premium proxy solutions for businesses worldwide.