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.19k stars 1.16k forks source link

Feature request: Client-side choice of packets final destiny #509

Open jpmvferreira opened 8 months ago

jpmvferreira commented 8 months ago

Hi there, I was planning on using this program to possibly route the traffic from multiple Wireguard interfaces on my server, each of which listening to a different port. The way that this program works, I see no way of making this possible other than having multiple instances of udp2raw running simultaneously on different ports. This is not by itself a major issue, except that if you're trying to bypass firewalls you typically want udp2raw listening on port 443, to avoid suspicious.

Therefore, I would like to request a feature where the client would specify the IP and the port which he would like the packets to be redirected. Concretely, you would initialize the server by only specifying the port to listen on, i.e.

$ udp2raw -s -a -l 0.0.0.0:443

and the client would then point to the server and make a request for the final location of the packet, i.e.

$ udp2raw -c -l 0.0.0.0:3333 -r <server IP>:443 --redirect-to <final destination IP>:<port>

This would allow for a single instance of udp2raw running on the server to serve multiple clients at the same time, to a flexible final destination, whether it would be on localhost (e.g.: multiple Wireguard interfaces each listening on a different point) or different servers via the udp2raw server.

wangyu- commented 5 months ago

we have more powerful alternative ways of doing this, for example:

ss client---->udp2raw client--------------------------------->udp2raw server---->ss server

in this way, a udp socks5 is exposed at client side, then you can choose any destination. you can even choose different destinations with same client

udp2raw -c -l 0.0.0.0:3333 -r :443 --redirect-to :

in your suggestion, you still have to start mutiple udp2raw client to connect to 2 different destinations.