xjasonlyu / tun2socks

tun2socks - powered by gVisor TCP/IP stack
https://github.com/xjasonlyu/tun2socks/wiki
GNU General Public License v3.0
2.86k stars 407 forks source link

Reverse socks2tun implementation #26

Closed undiabler closed 3 years ago

undiabler commented 3 years ago

I'm looking for reverse implementation converting many vpn/wireguard interfaces to socks5 proxy. For now I have plenty of hacks running lots of different socks servers via different users, then marking and properly routing traffic using iptables. All this stuff is very unstable.

Can you give me advise how network interfaces can be converted into socks5 proxy in easiest way? Thanks!

xjasonlyu commented 3 years ago

What do you mean convert interfaces to socks5 proxy?

Could you give me more context or examples?

undiabler commented 3 years ago

I want to use any existing network interface as socks5 proxy. For example curl can make http(s) request via selected interface with --interface parameter.

There are lots of applications supporting socks4/5 options. I want to have different vpn-s for different applications. I can reach this goal by seperating each application in different network environment as qubes os do. But the easiest way is to create socks server for each network interface (tun/tap/wg device).

xjasonlyu commented 3 years ago

Your needs are not related to this tun2socks project, but it's doable. A simple socks/http proxy server with BINDTODEVICE support would do the trick (I guess🙈).

undiabler commented 3 years ago

I have not found any simple socks/http proxy with BINDTODEVICE support. So I've implemented such trick for usocksd socks server. Thanks for your help.

ValdikSS commented 1 year ago

I have not found any simple socks/http proxy with BINDTODEVICE support.

Just for the record, I usually use https://3proxy.org/ as a proxy with outgoing ip/interface functionality.