xjasonlyu / tun2socks

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

UDP not works #74

Closed freeacetone closed 2 years ago

freeacetone commented 2 years ago

Environment

I saw Game ready: optimized UDP transmission in project description, but UDP taffic not works (also DNS too). In logs many lines like this:

level=warning msg="[UDP] dial 255.255.255.255:67 error: client hanshake: EOF"
level=warning msg="[UDP] dial 224.0.0.251:5353 error: client hanshake: EOF".

To Reproduce Steps to reproduce the behavior:

  1. Start: tun2socks-windows-amd64.exe -device tun://tun1 -proxy socks5://192.168.0.21:2010
  2. Set some IP address like 10.10.10.1 to new TUN manually
  3. Add route: route add 0.0.0.0 mask 0.0.0.0 10.10.10.1
xjasonlyu commented 2 years ago

It seems to be the problem of proxy server side. You see, the proxy server close the tcp connection (which is needed to be connected during the whole UDP session according to the RFC doc) and there's an EOF error when performing SOCKS5 UDP associate handshakes.

freeacetone commented 2 years ago

Hmm. So it's really works with another proxy server side settings. Now I'm trying to find the cause of the error. If I get anything concrete, I'll write it here for the story.

freeacetone commented 2 years ago

So if 3proxy.cfg contains just one any deny rule - UDP in tun2socks not works.

xjasonlyu commented 2 years ago

I’ve never used 3proxy, so I don’t have any idea about it. You may contact the author of 3proxy to indicate the problem.