SOCKS5 Proxy Setup
SOCKS5 is a versatile proxy protocol that works at the TCP level, supporting any application protocol -- not just HTTP. Hex Proxies provides SOCKS5 access on port 1080 at `gate.hexproxies.com`, backed by the full 10M+ residential and 250K+ ISP proxy network.
SOCKS5 vs HTTP Proxy
| Feature | HTTP Proxy | SOCKS5 | |---------|-----------|--------| | Protocol support | HTTP/HTTPS only | Any TCP protocol | | DNS resolution | Client-side by default | Proxy-side (SOCKS5h) | | Authentication | Basic/Digest | Username/Password | | Performance | Slightly faster for HTTP | More versatile | | Use cases | Web scraping, API calls | FTP, SMTP, custom TCP |
cURL with SOCKS5
# SOCKS5 with remote DNS resolution (recommended)
curl -x socks5h://YOUR_USERNAME:YOUR_PASSWORD@gate.hexproxies.com:1080 \# SOCKS5 with local DNS resolution curl -x socks5://YOUR_USERNAME:YOUR_PASSWORD@gate.hexproxies.com:1080 \ https://httpbin.org/ip ```
Python with PySocks
proxies = { 'http': 'socks5h://YOUR_USERNAME:YOUR_PASSWORD@gate.hexproxies.com:1080', 'https': 'socks5h://YOUR_USERNAME:YOUR_PASSWORD@gate.hexproxies.com:1080', }
response = requests.get('https://httpbin.org/ip', proxies=proxies, timeout=30) print(response.json()) ```
Install PySocks first: `pip install requests[socks]`
Node.js with socks-proxy-agent
import { SocksProxyAgent } from 'socks-proxy-agent';const agent = new SocksProxyAgent( 'socks5://YOUR_USERNAME:YOUR_PASSWORD@gate.hexproxies.com:1080' );
const response = await fetch('https://httpbin.org/ip', { agent }); const data = await response.json(); console.log(data); ```
Go with golang.org/x/net/proxy
dialer, err := proxy.SOCKS5( "tcp", "gate.hexproxies.com:1080", &proxy.Auth{User: "YOUR_USERNAME", Password: "YOUR_PASSWORD"}, proxy.Direct, ) ```
System-Wide SOCKS5 (macOS)
Configure SOCKS5 at the OS level so all applications route through the proxy:
- Open System Settings > Network > your network > Proxies.
- Enable SOCKS Proxy.
- Set server to `gate.hexproxies.com`, port `1080`.
- Enter your Hex Proxies credentials.
DNS Leak Prevention
Use `socks5h://` (note the `h`) in your client configuration. The `h` suffix tells the client to send DNS queries through the SOCKS5 proxy rather than resolving them locally. This prevents your ISP from seeing which domains you visit.
When to Use SOCKS5 over HTTP
- Non-HTTP protocols (FTP, SMTP, database connections)
- Applications that need TCP-level proxying
- When DNS privacy is critical (use socks5h)
- Chaining with other proxies
- Gaming or streaming applications