cybozu-go / transocks

Transparent SOCKS5 / HTTP proxy in Go
MIT License
467 stars 61 forks source link

How to bind transocks on primary address of internal network interface #32

Open yoyocat opened 2 years ago

yoyocat commented 2 years ago

There is a note on the README:

NOTE: If you are going to use transocks on Linux gateway to redirect transit traffic, you have to bind transocks on primary address of internal network interface because iptables REDIRECT action in PREROUTING chain changes packet destination IP to primary address of incoming interface.

I'm going to use transocks on Linux gateway, how do I do the binding? I'm a newbie. Sorry about the stupid question.

pooladkhay commented 1 year ago

Use "0.0.0.0" as your binding address:

proxy_url = "socks5://0.0.0.0:1080"  # for SOCKS5 server
#proxy_url = "http://0.0.0.0:3128"   # for HTTP proxy server