The project repo is migrated to https://git.ookami.one/cgit/proxy-ns.
proxy-ns is a lightweight(about 100 lines of code) tool to redirect any programs’ traffic to your local socks5 server.
Unlike proxychains
(which uses LD_PRELOAD
hack), it sets up a
vpn(using tun2socks
) within a specific linux network namespace, and
execute the target program there.
It has several advantages over proxychains
:
- UDP support
- Works for statically linked programs
proxy-ns is available at AUR
If you install it through AUR, the config file should be at
/etc/proxy-nsd.conf
.
You may need to change SOCKS5_PORT
SOCKS5_PORT=1080
DNS=9.9.9.9
# Set DNS_OVER_TCP to 1 to force DNS over TCP
DNS_OVER_TCP=1
proxy-nsd
would create a separate network namespace, and set up VPN
there(with badvpn-tun2socks
, redirecting VPN traffic to your socks5
server).
proxy-ns
execute your target program in the previous created network
namespace.
Because proxy-ns
execute the target program in a separate network
namespace, the target program cannot access any service listening on
your host network. (such as thoses listening on 127.0.0.1
)
Thereby, there are several things to notice:
Your local socks5 proxy server needs to listen on 0.0.0.0
(and ::
for IPv6),
and your firewall should allow traffic from 192.168.64.1/24
(subnet used by proxy-nsd
) to reach the port
your proxy server is listening on.
If you use proxy-ns
for programs already have proxy settings in
effect, the program will probably fail to connect to the network.
Then you should either only use the proxy settings of the program,
or only use proxy-ns
.