wangyu- / udp2raw

A Tunnel which Turns UDP Traffic into Encrypted UDP/FakeTCP/ICMP Traffic by using Raw Socket,helps you Bypass UDP FireWalls(or Unstable UDP Environment)
MIT License
7.36k stars 1.17k forks source link

Add option to enable SO_REUSEPORT for co-operating with natmap on router. #510

Open DiruSec opened 9 months ago

DiruSec commented 9 months ago

natmap was used for TCP / UDP hole punching under a NAT1 environment. For communication, user should:

After some tries, seems only the first method can co-operate with udp2raw. No data can be received by udp2raw server using port forwarding provided by firewall, and udp2raw client and server cannot establish connection using natmap's build-in forward feature.

201 talked about add SO_REUSEPORT for performance purpose. But seems SO_REUSEPORT is still not enabled at current.

natmap's solution for bind same port requires Linux kernel 5.6 or newer, though there's a number of routers using kernel older than 5.6.

I've compiled an udp2raw binary with SO_REUSEPORT enabled and it just works, so any plans for adding it as an option?

wangyu- commented 7 months ago

I've compiled an udp2raw binary with SO_REUSEPORT enabled and it just works, so any plans for adding it as an option?

can you show me which socket did you enable SO_REUSEPORT? (is it only server's listen socket?)

I can add it as an option in next release.