pufferffish / wireproxy

Wireguard client that exposes itself as a socks5 proxy
ISC License
4.54k stars 272 forks source link

UDP Support #30

Open pufferffish opened 2 years ago

pufferffish commented 2 years ago

Currently wireproxy doesn't have UDP support at all. There is no support for UDP Associate in SOCKS5, and UDP tunnels have not been implemented.

Challenges:

PoneyClairDeLune commented 2 years ago

Will HTTP/3 implementations in browsers use UDP ASSOCIATE? And is WireProxy going to support FullCone (endpoint independent NAT mapping and filtering, RFC 4787)?

pufferffish commented 2 years ago

Will HTTP/3 implementations in browsers use UDP ASSOCIATE?

This depends on what browser or what proxy plugin you're using on your browser. I haven't investigated this so I'll have to give it a look.

And is WireProxy going to support FullCone (endpoint independent NAT mapping and filtering, RFC 4787)?

Part of the challenge in supporting UDP proxying is picking a proper NAT mapping. Full-cone NAT is the easiest to implement so I might pick this one, but at the same time it can quickly exhaust ports if there are a lot of proxied UDP traffic from different ports. I think I'll implement full cone NAT first, see how it works out, and implement other NAT types if it proves to be insufficient.

PoneyClairDeLune commented 2 years ago

Will HTTP/3 implementations in browsers use UDP ASSOCIATE?

This depends on what browser or what proxy plugin you're using on your browser. I haven't investigated this so I'll have to give it a look.

And is WireProxy going to support FullCone (endpoint independent NAT mapping and filtering, RFC 4787)?

Part of the challenge in supporting UDP proxying is picking a proper NAT mapping. Full-cone NAT is the easiest to implement so I might pick this one, but at the same time it can quickly exhaust ports if there are a lot of proxied UDP traffic from different ports. I think I'll implement full cone NAT first, see how it works out, and implement other NAT types if it proves to be insufficient.

And... When will UDP support arrive?

JJRcop commented 2 years ago

A mainstream program qBitTorrent supports µTP, which is a UDP based torrent protocol. You can set it to only accept µTP connections through connection settings, and try downloading something popular like Ubuntu.

Right now with wireproxy, setting it to µTP only with the SOCKS5 proxy set up stalls all torrents forever, it's a great way to test.

JJRcop commented 2 years ago

Related: #37

EasyLim commented 1 month ago

Today Discord was blocked in Russia.

I tried to use your project to make a local proxy and selectively send traffic through wireguard (make some of the traffic go through wireguard, and the other part as usual) using PAC script. And everything works successfully, all sites work, but Discord voice chats don't work. I suspect this is because you don't have UDP support, so I'd like to see UDP support as soon as possible.

Maybe there are some other solutions, how can I selectively route traffic through wireguard?