ambrop72 / badvpn

NCD scripting language, tun2socks proxifier, P2P VPN
Other
1.85k stars 603 forks source link

[tun2socks] support unix socket SOCKS #68

Open lesion opened 5 years ago

lesion commented 5 years ago

Hi. Is it possible to use a unix socket as SOCKS destination? We want to use this to forward traffic to Tor (SocksPort options support listening over a unix socket)

Thanks

ambrop72 commented 5 years ago

Hi, It should be doable with some code changes. Basically, in BSocksClient.c, where the call BConnector_Init is made, you need to do BConnector_InitUnix instead. There would be some work adapting tun2socks.c and BConnection.h/c to support that kind of address (currently they assume BAddr which can only hold IP addresses).

4-FLOSS-Free-Libre-Open-Source-Software commented 3 years ago

Windows compatibility sockaddr_un see: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/