Install
shell
# Debian / Ubuntu
sudo apt-get install proxychains4
# Arch
sudo pacman -S proxychains-ng
# macOS (Homebrew)
brew install proxychains-ng
# From source
git clone https://github.com/haad/proxychains-ng
cd proxychains-ng && ./configure --prefix=/usr --sysconfdir=/etc && make && sudo make install
Configuration
The config file lives at /etc/proxychains4.conf (system-wide) or ~/.proxychains/proxychains4.conf (per-user). The per-user location takes precedence.
~/.proxychains/proxychains4.confshell
strict_chain
proxy_dns # resolve DNS through the proxy, not locally
quiet_mode
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
# type host port user pass
http gw.justproxies.online 8080 USER PASS
proxy_dns prevents DNS leaks — without it your resolver sees the hostnames even though the connections go through the proxy. Always enable it.The four modes at the top of the config control chain behaviour:
strict_chain— every connection must go through the whole list in order. Fails loudly if the proxy is unreachable. Use this.dynamic_chain— skips dead proxies silently. Useful for a list of fallback proxies.random_chain— picks a random proxy from the list per connection. Not useful with a single entry.
Using with system tools
Prefix any command with proxychains4. The tool intercepts the binary's socket calls at runtime.
shell
# Check your exit IP
proxychains4 curl -s https://api.ipify.org
# Download a file
proxychains4 wget -q -O archive.tar.gz https://example.com/archive.tar.gz
# Git clone through the proxy
proxychains4 git clone https://github.com/org/repo.git
# apt package update (useful on servers behind restrictive firewalls)
proxychains4 apt-get update
# pip install
proxychains4 pip install somepackage
# SSH to a remote host (TCP only)
proxychains4 ssh [email protected]
Quiet mode
Without quiet_mode in the config, proxychains4 prints a line to stderr for every connection it intercepts. Enable it to keep script output clean.Caveats and limitations
- UDP does not work through HTTP proxies. proxychains4 intercepts TCP only. DNS is handled via a special TCP trick when
proxy_dnsis on. - Statically linked binaries (Go programs, some system tools) bypass proxychains because they don't use the dynamic linker. For those, use environment variables:
HTTP_PROXYandHTTPS_PROXY. - Root processes —
sudodrops environment variables and library paths. Pass-Eto preserve the environment, or prefix thesudocommand itself with proxychains4. - Rotation — a single
[ProxyList]entry with our gateway gives you IP rotation automatically because the gateway rotates on every connection. You don't need multiple proxy entries.
Alternate: environment variables for Go/static binariesshell
export HTTP_PROXY=http://USER:[email protected]:8080
export HTTPS_PROXY=http://USER:[email protected]:8080
# Now static-binary tools pick it up
./my-go-binary --target https://api.ipify.org