wongsyrone / transocks-wong

A redsocks-like transparent IPv4/IPv6 TCP-to-SOCKS5 redirector (for Linux only)
GNU General Public License v2.0
63 stars 15 forks source link

Feature request: SOCKS5 UDP support #5

Open ghost opened 4 years ago

ghost commented 4 years ago

Would you consider supporting UDP over SOCKS5 with iptables TPROXY ? It would be great for DNS queries and gaming.

phantomcraft commented 4 years ago

I don't want to make spam, but there is a project which supports UDP and TPROXY, called ipt2socks:

https://github.com/zfl9/ipt2socks

As it uses libev, should support splice syscall.

ghost commented 4 years ago

@phantomcraft have you tried ipt2socks before? I have no luck trying that.. it just keeps crashing

phantomcraft commented 4 years ago

@ulinuxp Yes, I tested it but only the "redirect" scheme, not the "tproxy". I really don't know how to forward UDP to a subnet with "tproxy", with "redirect" I just use:

iptables -t nat -A PREROUTING -i subnet0 -p tcp --syn -j DNAT --to-destination :

Worked well and seems to use splice syscall as the speed reached ~30gbps in my system.