qwj / python-proxy

HTTP/HTTP2/HTTP3/Socks4/Socks5/Shadowsocks/ShadowsocksR/SSH/Redirect/Pf TCP/UDP asynchronous tunnel proxy implemented in Python 3 asyncio.
MIT License
1.99k stars 333 forks source link

Question about iptables #170

Closed armin567ip closed 1 year ago

armin567ip commented 1 year ago

Hi. I'm an Iranian user and I have a question about the usage of IPtables in this project. Well sometime the government shutdown the whole Internet of outside world so we'll have the "National Internet" (only iranian websites). In those cases the only solution is using iptables. we have to have 2 servers. one VPS in Iran and one VPS outside Iran. then we can run a VPN server on the EU server (Any type, mostly we use V2ray protocols). Then we have to run this IPtable command on the VPS in Iran so we will be able to access the Internet.

sysctl net.ipv4.ip_forward=1 iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-destination IRAN_IP iptables -t nat -A PREROUTING -j DNAT --to-destination EUROPE_IP iptables -t nat -A POSTROUTING -j MASQUERADE

Now I have a question. How can I use this exact same command but using your project and on a VPS without root access. Since you mentioned in the repo, This project is Python only and doesn't require root access. so that's what I want.