This document is a concise usage and build guide for the proxychains-rs repository (version 5.0.0). It focuses on building, running and debugging the Rust implementation that provides proxychains-compatible behavior, and also covers common issues.
proxychains-rs (v5.0.0) is a Rust implementation that aims to be compatible with existing proxychains behavior. Its goal is to produce a shared library that can be injected into target programs using LD_PRELOAD and that behaves (including textual output) consistently with prior implementations. The runtime artifact produced by this project is libproxychains_rs.so.
Main runtime artifact (release):
target/release/libproxychains_rs.so— the shared object produced by Rust (cdylib).
Note: The supported runtime artifact is target/release/libproxychains_rs.so. The project does not rely on producing a compatibility copy named libproxychains4.so by default anymore.
Tip: this repository contains a rust-toolchain pin (nightly). Cargo will automatically use the pinned nightly toolchain when building the project.
Important: the repository uses some Rust nightly-only features in parts of the codebase (for example c_variadic / extern_types). Because of this, a nightly toolchain is required to build.
- Ensure you have rustup installed and enable the nightly toolchain:
rustup toolchain install nightly- Build the project using cargo from the
proxychains-rsdirectory:
# Build the Rust portion using the nightly toolchain
rustup run nightly cargo build -p proxychains_rs --releaseThis will produce the shared object under target/release/libproxychains_rs.so.
To use proxychains-rs with any dynamically linked program that supports LD_PRELOAD, set the configuration file path and LD_PRELOAD the built shared object:
PROXYCHAINS_CONF_FILE=/etc/proxychains.conf LD_PRELOAD=target/release/libproxychains_rs.so curl -I https://www.baidu.comIf you are replacing an existing proxychains4 script or binary (the C-based tool), the Rust version aims to be consistent in behavior and log text. Using target/release/libproxychains_rs.so as LD_PRELOAD should act as a drop-in replacement for the C artifact.
An example wrapper similar to /usr/bin/proxychains:
#!/bin/sh
echo "ProxyChains-5.0"
if [ $# = 0 ]; then
echo "\tusage:"
echo "\t\tproxychains <prog> [args]"
exit
fi
export LD_PRELOAD=libproxychains_rs.so
exec "$@"-
Configuration file search order (priority):
PROXYCHAINS_CONF_FILEenvironment variable (or-fargument)./proxychains.confin the current directory$(HOME)/.proxychains/proxychains.conf- System config
/etc/proxychains.conf(sysconfdir)
-
Settings in the configuration file:
quiet_mode— suppresses the per-connection log lines (same as the C implementation).proxy_dns,proxy_dns_daemon,proxy_dns_old— control remote-DNS (RDNS) behavior/modes.
-
Environment variables:
PROXYCHAINS_VERBOSE_DEBUG=1— enable extra internal debug traces for development and troubleshooting.
- Q: Why is a nightly toolchain required to build?
- A: The port uses Rust features that are currently only available on the nightly channel (for example
c_variadic/extern_types). That's why the nightly toolchain is required.
- A: The port uses Rust features that are currently only available on the nightly channel (for example
- Reduce or remove
unsafeandstatic mutusage where practical and refactor key paths to be more idiomatic Rust (long-term goal). - Improve cross-platform support.