Proxy Chaining: Layered Anonymity
Proxy chaining routes your traffic through multiple proxy servers in sequence. Each hop adds a layer of indirection, making it significantly harder to trace requests back to the origin. Hex Proxies supports chaining through its 10M+ IP residential network and 250K+ ISP proxies.
Why Chain Proxies
- **Enhanced anonymity**: Each hop only knows the previous and next node, not the full path.
- **Geographic diversity**: Route through multiple countries in a single request chain.
- **Defense in depth**: If one proxy is compromised, the full chain remains protected.
Chaining with ProxyChains (Linux/macOS)
ProxyChains is the most common tool for transparent proxy chaining:
# Install proxychains
# macOS: brew install proxychains-ng# Edit /etc/proxychains4.conf (or proxychains.conf) ```
# proxychains4.conf
strict_chain
proxy_dns
tcp_read_time_out 15000[ProxyList] http gate.hexproxies.com 8080 YOUR_USERNAME YOUR_PASSWORD socks5 gate.hexproxies.com 1080 YOUR_USERNAME_2 YOUR_PASSWORD_2 ```
# Run any command through the chain
proxychains4 curl https://httpbin.org/ip
proxychains4 python3 my_scraper.pyChaining in Python
import requests# First hop: SOCKS5 proxy first_hop = "socks5://YOUR_USERNAME:YOUR_PASSWORD@gate.hexproxies.com:1080"
# Create a session that routes through the first hop session = requests.Session() session.proxies = { "http": first_hop, "https": first_hop, }
# The request exits through the SOCKS5 proxy # For a second hop, configure the first proxy to forward to another response = session.get("https://httpbin.org/ip") print(response.json()) ```
SSH Tunnel + Proxy Chain
Create a local SOCKS5 tunnel, then chain it with a Hex Proxies exit node:
# Step 1: Create SSH SOCKS tunnel on port 9050# Step 2: Configure proxychains to go through SSH then Hex Proxies # [ProxyList] # socks5 127.0.0.1 9050 # http gate.hexproxies.com 8080 YOUR_USERNAME YOUR_PASSWORD ```
Chaining Modes
- **strict_chain**: Requests must pass through every proxy in order. If one fails, the entire request fails. Most secure but least fault-tolerant.
- **dynamic_chain**: Skips dead proxies and continues through the remaining chain. More resilient but slightly less predictable.
- **random_chain**: Picks a random subset of proxies from the list. Adds unpredictability at the cost of consistency.
Performance Impact
Each hop adds latency. A two-hop chain typically adds 100-300ms compared to a single proxy. For most use cases, two hops provide strong anonymity without unacceptable performance loss. Three or more hops are rarely necessary outside of high-security scenarios.
Verification
Always verify your chain is working correctly:
# Check exit IP# Verify DNS is not leaking proxychains4 curl -s https://dnsleaktest.com/api/v1/ ```