v1.10.90-0e025b8
Skip to main content
Back to Hex Proxies

SOCKS5 Proxy Setup

Last updated: April 2026

By Hex Proxies Engineering Team

Configure SOCKS5 proxies with Hex Proxies for full TCP-level proxying. Covers protocol differences, client setup in multiple languages, and DNS leak prevention.

intermediate20 minutesprotocol-setup

Prerequisites

  • Basic understanding of network protocols
  • Hex Proxies account with credentials

Steps

1

Choose SOCKS5 vs HTTP

Use SOCKS5 for non-HTTP protocols, DNS privacy, or TCP-level proxying. Use HTTP proxy for standard web scraping.

2

Configure your client

Point your application to gate.hexproxies.com:1080 with SOCKS5 protocol and your credentials.

3

Use socks5h for DNS privacy

Add the h suffix (socks5h://) to route DNS queries through the proxy and prevent leaks.

4

Test the connection

Use curl with -x socks5h:// to verify the proxy is working and the exit IP is different.

5

Check for DNS leaks

Verify that DNS queries are resolved by the proxy, not your local resolver.

6

Monitor performance

SOCKS5 adds minimal overhead — monitor latency to ensure it meets your requirements.

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 access to a 10M+ residential IP network through partner agreements and the full multi-carrier US ISP network.

SOCKS5 vs HTTP Proxy

FeatureHTTP ProxySOCKS5
Protocol supportHTTP/HTTPS onlyAny TCP protocol
DNS resolutionClient-side by defaultProxy-side (SOCKS5h)
AuthenticationBasic/DigestUsername/Password
PerformanceSlightly faster for HTTPMore versatile
Use casesWeb scraping, API callsFTP, SMTP, custom TCP

cURL with SOCKS5

# SOCKS5 with remote DNS resolution (recommended)
curl -x socks5h://YOUR_USERNAME:YOUR_PASSWORD@gate.hexproxies.com:1080 \
     https://httpbin.org/ip

SOCKS5 with local DNS resolution curl -x socks5://YOUR_USERNAME:YOUR_PASSWORD@gate.hexproxies.com:1080 \ https://httpbin.org/ip ```

Python with PySocks

import requests

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';
import fetch from 'node-fetch';

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

import "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:

  1. Open System Settings > Network > your network > Proxies.
  2. Enable SOCKS Proxy.
  3. Set server to gate.hexproxies.com, port 1080.
  4. 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

Tips

  • Always use socks5h:// (with h) to prevent DNS leaks — this routes DNS through the proxy.
  • SOCKS5 works for any TCP protocol, not just HTTP — use it for FTP, SMTP, or custom protocols.
  • Install PySocks (pip install requests[socks]) before using SOCKS5 in Python requests.
  • SOCKS5 on Hex Proxies uses port 1080, while HTTP proxy uses port 8080.

Ready to Get Started?

Put this guide into practice with Hex Proxies.