xjasonlyu / tun2socks

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

[Bug] udp not working #163

Closed snltty closed 1 year ago

snltty commented 1 year ago

Verify steps

Version

2.4.1

What OS are you seeing the problem on?

Windows

Description

tun2socks-windows.exe -device p2p-tunnel -proxy socks5://127.0.0.1:5412 -loglevel silent

in the socks5, step command, tcp is ok , udp got 0.0.0.0:0 target ipendpoint 1

CLI or Config

No response

Logs

No response

How to Reproduce

No response

xjasonlyu commented 1 year ago

The UDP ASSOCIATE request is used to establish an association within the UDP relay process to handle UDP datagrams. The DST.ADDR and DST.PORT fields contain the address and port that the client expects to use to send UDP datagrams on for the association. The server MAY use this information to limit access to the association. If the client is not in possesion of the information at the time of the UDP ASSOCIATE, the client MUST use a port number and address of all zeros.

This might be your socks server side’s problem. In socks5, client can use unspecific ip (in this case, 0.0.0.0) as target ip and zero port number as target port, but obviously your socks server doesn’t support this feature. So you may should contact your server provider about this issue.

snltty commented 1 year ago

Thank you~ I'll try

snltty commented 1 year ago

command 0x03 is, UDP ASSOCIATE 2

xjasonlyu commented 1 year ago

yep

snltty commented 1 year ago

I Dont Understand why command step got 0.0.0.0:0

tun2socks ip 192.168.54.11

connect code 3