Proxy Chaining Setup: A ProxyChains-NG Guide for Scrapers

Proxy chaining sends your traffic through two or more proxies in sequence, so the destination sees only the last one. On Linux, macOS and BSD the standard way to set it up is ProxyChains-NG: install it, list your proxies in one config file, pick a chaining mode and prefix your command. For data collection the choice that matters most is the last hop, because that is the IP the target site judges. We build that hop as a real US carrier IP, so your chain exits looking like an ordinary mobile user in a specific city.
TL;DR
- ProxyChains-NG forces any TCP connection from a program through a chain of SOCKS4a, SOCKS5 or HTTP proxies. It does not carry UDP or ICMP.
- Use
strict_chainwhen order matters,dynamic_chainwhen some hops may be down, andrandom_chainto vary the route. - Turn on
proxy_dnsand verify with a direct run and a proxied run. The proxied run must show a different IP, and a dead proxy must fail rather than fall back to direct. - Keep chains short. Every extra hop adds latency, and the exit hop decides how the target sees you.
- For scraping and geo-targeted research, make the exit hop a real mobile carrier IP in the city you need.
Table of Contents
- What proxy chaining does and when you need it
- How ProxyChains-NG works
- Install ProxyChains-NG
- Choose a chaining mode
- Configure the proxy list
- Run an application through the chain
- Verify the route and the exit IP
- Troubleshoot a failing chain
- Design a chain that suits data collection
- Start with the exit hop
- FAQ
- Sources
What proxy chaining does and when you need it
A proxy chain is a path: your client connects to proxy A, A connects to proxy B, B connects to the target. Each hop only knows its neighbors. The target sees B's address, and A never sees the destination in the clear when the hops are encrypted or tunneled.
The ProxyChains-NG project lists seven use cases. Three matter most for data work:
- Your network only allows traffic out through a proxy, and you need to continue to a second one.
- A tool has no proxy support of its own (telnet is the README's example), so you wrap it.
- You want to chain two or more proxies in a defined order.
A chain is a routing tool, not a quality upgrade. A chain of weak exit IPs is still a weak exit IP. If your goal is a clean, city-specific request, one well-chosen exit hop often does more than four hops of anonymity. Vendors that document chaining also treat it with care: Zscaler supports it but does not recommend it as a long-term production solution, because multiple proxies add latency and failover is manual.
That shapes the design below: few hops, a known exit, and a test you can repeat.
How ProxyChains-NG works
ProxyChains-NG (the 4.18 README is the reference here) is a UNIX program that hooks network-related libc functions in dynamically linked programs through a preloaded library (LD_PRELOAD). It redirects their connections through SOCKS4a, SOCKS5 or HTTP proxies. It supports TCP only, and it runs on Linux, BSD, Mac and Haiku.
Three consequences follow:
- Dynamically linked programs only. Statically linked binaries, and some runtimes that make system calls directly, bypass the hook. Go programs are a common surprise.
- TCP only. HTTP(S) scraping, SSH and database connections work. UDP-based traffic such as QUIC/HTTP3 or plain DNS over UDP does not travel the chain.
- Per-process scope. Only the command you prefix is proxied, not the whole machine. That is useful when one scraper needs a chain and everything else should go direct.
If you are choosing hop types, our guide to SOCKS5 versus HTTP proxies covers how each handles DNS, and the comparison of HTTP and HTTPS proxies covers when each fits. For a broader view of the tooling around network security, this overview of network security tools gives useful context.
Install ProxyChains-NG
Most Linux distributions package it as proxychains4 or proxychains-ng. To build from source, the README gives these steps:
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
sudo make install-config
The last command writes the default config to /etc/proxychains.conf. You can also keep a per-project file and point to it with -f:
proxychains4 -f ./scraper-chain.conf python scrape.py
A per-project file keeps credentials and hop order out of the system default and makes the setup reproducible across a team.
Choose a chaining mode
The README and sample config describe the modes. Enable exactly one by uncommenting its line.
| Mode | Behavior | Use it when |
|---|---|---|
strict_chain | Uses every proxy in the exact order listed. If one is down, the connection fails. | The route is a requirement, for example a jump host first, then the exit. |
dynamic_chain | Same order, but dead proxies are skipped. | You maintain several hops and want resilience. |
random_chain | Picks proxies in random order, with a chain length you set. | You want to vary routes across runs. |
The README's changelog also notes that a round-robin mode was added in version 4.7, which cycles through the list.
For data collection we suggest strict_chain while you build and test, since a silent skip hides a broken hop, and dynamic_chain only once each hop has been verified. If you need the exit IP to stay controlled, avoid random_chain: a random order can change which proxy is last.
Configure the proxy list
Open your config file and set the mode, DNS handling and timeouts, then add the list at the bottom under [ProxyList]. A minimal two-hop strict chain looks like this:
strict_chain
proxy_dns
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
socks5 10.0.0.5 1080 jumpuser jumppass
http proxy.example.com 8080 USERNAME PASSWORD
Each line follows the pattern type host port [user pass]. Supported types are http, socks4 and socks5. Order matters: the first line is the first hop and the last line is the exit.
A few details that cause most failed setups:
- Leave only one mode enabled. Two uncommented modes give confusing behavior.
- Quote nothing. Values are space-separated and not quoted; special characters in passwords can break parsing, so prefer credentials without spaces.
- Keep the timeouts generous at first. Mobile networks can add latency on the first connection of a session. Tighten the values after you have measured.
- Match type to port. Pointing a
socks5line at an HTTP port gives a handshake failure that looks like a dead proxy.
Put a mobile carrier IP at the end
The last line of the list is what the target sees. For scrapers, price monitors and ad verification, a datacenter exit is the one that gets throttled or blocked, because its address range is plainly commercial. Our exit hops are real US carrier IPs, so requests look like those of a genuine mobile user. You can target any of 46 US cities and choose rotating or sticky sessions. The service accepts HTTP, HTTPS and SOCKS5, so it slots into the final line of the chain as socks5 or http with your credentials.

Session type matters in a chain. If your workflow needs the same IP across a login and several page loads, use a sticky session on the exit hop. If each request should come from a fresh IP, use rotating. Our notes on session management for stable proxy workflows explain how to pick.
Run an application through the chain
Prefix any command with proxychains4:
proxychains4 curl https://api.ipify.org
proxychains4 python scrape.py
proxychains4 -q node crawler.js
The -q flag silences ProxyChains' own output, which is handy in cron jobs but worth removing while debugging, because the log lines show each hop being tried.
For browsers, a command-line wrapper is often less reliable than setting the proxy in the browser itself. If you drive Chrome or a browser automation tool, see our reference on Chrome proxy flags, which covers --proxy-server and related options.
Verify the route and the exit IP
A chain that appears to work and a chain that works are different things. A fail-closed validation flow, described in the proxychains-rs validation manual, is a good model for any ProxyChains setup:
- Direct path: run the check without the wrapper. It must show your normal egress IP.
- Valid chain: run it with the wrapper. It must show a different IP, the exit hop's.
- Invalid chain: break one hop on purpose, for example by changing a port. The command must fail with a non-zero exit code (curl usually returns 7) instead of quietly going direct.
- DNS check: with
proxy_dnson, name lookups inside the proxied process should return a placeholder address in the 224.x range (or its IPv6-mapped form), which shows the name is resolved by the proxy and not by your machine.
A runnable version in a shell script:
curl -s https://api.ipify.org; echo
proxychains4 -q curl -s https://api.ipify.org; echo
The two lines should print different addresses. Then check that the exit IP matches what you bought: right country, right city. For a systematic way to score this, see our write-up on verifying proxy geolocation, and for tools that test rotation and speed, our list of proxy checker tools. The pattern of checking each layer in turn is also familiar from infrastructure DNS troubleshooting.
If you want copy-paste commands for inspecting what resolves where, our curl proxy command reference has five.
Troubleshoot a failing chain
Work from the first hop outward, and change one thing at a time.
| Symptom | Likely layer | What to do |
|---|---|---|
| Connection refused or timeout on hop one | Network path or wrong port | Test hop one alone with curl and the --proxy flag. |
| Handshake or authentication error | Wrong type or credentials | Confirm socks5 versus http and re-enter the username and password. |
Works in dynamic_chain, fails in strict_chain | One hop is down | Run each hop alone to find which one. |
| Your real IP appears | Program bypasses the hook | Check the binary is dynamically linked, or set the proxy inside the app. |
| Name resolution fails | DNS not proxied | Enable proxy_dns, and confirm the placeholder test above. |
| Very slow responses | Too many hops or distant hops | Cut the chain to the fewest hops you need and raise timeouts. |
| QUIC or UDP traffic ignored | TCP-only limit | Disable HTTP/3 in the client so it uses TCP. |
One check saves hours: test each hop by itself before you combine them. A chain only fails at the layer where one of its links does. Our guides to proxy error troubleshooting and mobile proxy debugging walk through finding the failing layer, and the one on failover strategies shows how to stop wasting retries when a hop does fail.
Design a chain that suits data collection
A few rules we apply to scraping and research setups:
- Two hops are usually enough. One hop to satisfy a network policy or a jump host, one exit. More hops add delay and more points of failure.
- Choose the exit for the target, not for secrecy. Geo-targeted traffic analysis, regional price comparison and local search testing all depend on the exit city.
- Keep one config per project. Name files by target and region so a result can be traced to the route that produced it.
- Log the exit IP with every batch. It makes outlier results explainable.
- Rotate on purpose. Use sticky sessions for stateful flows and rotating ones for independent requests.
From our side
Most chaining tutorials are about hiding. Teams who collect data care about something else: whether the response they get is the response a real local user would get. That is decided at the exit. A chain can hide where you started, but it cannot make a datacenter address look like a phone on a carrier network.
That is why we run real US mobile carrier IPs, with city-level targeting, sticky and rotating sessions, and support for HTTP, HTTPS and SOCKS5. Those are the pieces a chain needs from its last hop: a protocol your wrapper understands, and an address that reads as a normal mobile user. You set it up yourself, with self-serve credentials and a usage dashboard, and no sales call.
Our advice is simple. Build the shortest chain that meets your network constraints, test every hop alone, and spend your effort on the exit.
Jon
Start with the exit hop
If you are ready to put a real carrier IP at the end of your chain, our plans are billed monthly by data pool size: Starter at $30.00 per month, Basic at $100.00, Advanced at $500.00 and Scale at $1,000.00. There is a free trial with limited data, and prepaid data add-ons are billed per GB, so you can run the verification steps above on your own chain first.

Credentials are managed in your account, including for teams, and API access is included. You can see the supported languages and tools on our integrations section, or review the full feature list.
FAQ
Is proxy chaining the same as using a VPN?
No. A VPN usually tunnels all of a device's traffic through one provider. ProxyChains-NG routes selected programs' TCP connections through one or more proxies you list. You control order, type and scope per command.
Does proxy chaining make scraping safer from blocks?
Not by itself. The target judges the last hop, so the quality of the exit IP matters more than the number of hops. A real mobile carrier IP in the right city, with the right session type, is the part of the chain that shapes how requests are received.
Why does my real IP still show up?
Usually the program is not hooked. ProxyChains-NG works with dynamically linked programs and TCP only, so statically linked binaries or UDP traffic bypass it. Run the direct versus proxied comparison, and set the proxy inside the application if the wrapper does not take effect.
Should I use strict or dynamic chaining?
Use strict_chain while testing, so a broken hop is visible, and dynamic_chain once every hop is verified and you want resilience. Avoid random order when the exit hop must stay fixed.
Sources
- ProxyChains-NG README (version 4.18)
- ProxyChains-NG sample proxychains.conf
- Configuring Proxy Chaining, Zscaler documentation
- Forced proxy validation manual, proxychains-rs
- Network security tools: types, uses and how to choose
- CoreDNS failures in Kubernetes: why DNS resolution breaks