net4people / bbs

Forum for discussing Internet censorship circumvention
3.47k stars 82 forks source link

Help with WebRTC proxying in UAE #135

Open Azuriye opened 2 years ago

Azuriye commented 2 years ago

Hello, I have a VPS on Amsterdam and it's been a year long of searching (and still continuing) in finding a VPN software which does not disconnect on long sessions and which can proxy applications as well. I've so far only found V2Ray which did the job and a particular software called NetchX which uses WinTun? to proxy it's apps and works well when it comings to proxying applications which have WebRTC problems like Discord and etc. It does not disconnect in between as well and it's stable so far only issue being that streaming quality is really poor on discord (video is totally pixelated) but voice chat is smooth.

I've only found this type of setup working for me (So far I only use a VPN to unblock my Discord here and then use it sometimes on web browsers to unblock websites) but I'm totally surprised if this is the only way known here so far by someone in the UAE? I've tried OpenVPN but it gets blocked/throttled, Wireguard disconnects in between once in a while (Note that I've been using mullvad before and experienced these issues) decided to buy my own VPS server and install V2ray.

I wanted to know if there's any software out there which does exactly how I want? Proxying webRTC applications and not having poor streaming quality? Or if it's out of reach... I'm not sure of anyone down in my country who would go through lengths to just unblock Discord since most either use a free/paid VPN and go system-wide. I'm totally clueless if someone could help me out it'd be great.

wkrp commented 2 years ago

Maybe others can comment with more specific advice about transports or the network situation in the UAE. Shadowsocks supports UDP proxying, which will be required for WebRTC, but with WebRTC there is the additional complication that it needs to know your external IP address (for the initial offer/answer negotiation) and so it may not be compatible with simple proxying, rather requiring an OS-level VPN.

You could try some of the simple WireGuard obfuscation mechanisms:

Azuriye commented 2 years ago

Hello regarding Wireguard, the other day I've tried using AllowedIP field to mention all the discord routes, so far there are some on https://github.com/ElDavoo/wireguard-discord/blob/main/discord.txt and I started building my own list from that.

What I've noticed in Wireshark is that discord sends the voice channel DNS with the regex .discord.media ( can be rotterdam1087, dubai46 and etc.) It even shows what voice channel location your connected to! (Silly me I haven't figured out back then) So I decided to just ping the DNS, use a subnet of /32 from the IPv4 address I've received while pinging and now Discord's WebRTC gets routed to my Wireguard server.

Only drawback is that there might be times where it's residing in a totally different IP address and it gets routed out and I need to do the above mentioned steps again, only if there was a way to collect the DNS name field, convert to IPv4 and automatically builds it up in the AllowedIP sector. But glad that I've found some make shift solution for now.

(P.S Just to mention I'm using Windows for now and planning to check regarding namespaces for Linux later. I've also switched to a provider called Mullvad since I just can't figure out how to get Socks5 working on my server with Wireguard apart from the SSH method)

ghost commented 2 years ago

Use V2RayN, set it to socks5 at 127.0.0.1:10808,

image

image

use Proxifier to force all applications on the computer to go through 127.0.0.1:10808 socks5 proxy.

image

in Proxifier settings, do these:

image

image

also make an exception for V2RayN's components to bypass Proxifier proxy and connect directly to the Internet.

image

I can confirm it works with anything, WebRTC included. personally tested it with Discord web on Edge browser, voice call, video call, group chat video call, group chat voice call. Windows 11 latest version.

https://www.proxifier.com/docs/win-v4/dns.html

https://www.proxifier.com/docs/win-v4/services.html

Azuriye commented 2 years ago

Hey, I used to have Proxifier as well, if I do recollect the latest version of Proxifier for some reason was getting flagged by BattleEye instance and had to revert to an older version but apart from that, if I am not wrong wouldn't this just tunnel all the apps through a socks5 proxy (a system wide VPN?) sort of a bit lost since I am trying to find a way to split tunnel in Windows.

ghost commented 2 years ago

Hey, I used to have Proxifier as well, if I do recollect the latest version of Proxifier for some reason was getting flagged by BattleEye instance and had to revert to an older version but apart from that, if I am not wrong wouldn't this just tunnel all the apps through a socks5 proxy (a system wide VPN?) sort of a bit lost since I am trying to find a way to split tunnel in Windows.

of course, you can split tunnel as well, have everything connect directly to the Internet, only force Discord to use Proxifier, everything can be done using rules section in the app.

about anti cheat, I'm not sure, it's battle eye's fault. I personally stopped using PC for gaming and now use Xbox Series X, the console supports Discord calling and game pass, everything I need. mainly because it's recommended to use a Standard account for everyday usage on Windows instead of Admin, just like on Android/IOS that you don't use Rooted phone for everyday use. but games need Admin access to install their rootkits (the so-called anti-cheat functionalities) and they collect too much data which is unacceptable. Battle Eye and things like that install kernel mode drivers, having full control over your system. it's not safe.

Azuriye commented 2 years ago

Hello, I've tried the above settings but am still unable to proxy WebRTC with Proxifier... Not sure if anything has changed between the versions but I am using v3.42. To double-check check here are the screenshots

Here it shows up properly I am connected to a WebRTC channel (in Proxifier as well as v2rayN's logs respectively) image image

But Developer Tools (since Discord is a chromium process) shows my UAE IP instead of my VPS (Situated in Amsterdam) IP address. This was precisely the issue I was running at. image

These are the settings I have so far applied in v2rayN. image image

The same goes with Proxifier as well. image image image

Please let me know if I am missing out on something, or whether it's an issue with Proxifier versions.

PS: - Just tried it with Proxifier v4, same issue a few minutes before posting this update so I doubt it's a version issue and most likely has something to do with routing. Most likely where wkrp mentioned how WebRTC works...

it needs to know your external IP address (for the initial offer/answer negotiation)

ghost commented 2 years ago

Hello, I've tried the above settings but am still unable to proxy WebRTC with Proxifier... Not sure if anything has changed between the versions but I am using v3.42. To double-check check here are the screenshots

Here it shows up properly I am connected to a WebRTC channel (in Proxifier as well as v2rayN's logs respectively) image image

But Developer Tools (since Discord is a chromium process) shows my UAE IP instead of my VPS (Situated in Amsterdam) IP address. This was precisely the issue I was running at. image

These are the settings I have so far applied in v2rayN. image image

The same goes with Proxifier as well. image image image

Please let me know if I am missing out on something, or whether it's an issue with Proxifier versions.

PS: - Just tried it with Proxifier v4, same issue a few minutes before posting this update so I doubt it's a version issue and most likely has something to do with routing. Most likely where wkrp mentioned how WebRTC works...

it needs to know your external IP address (for the initial offer/answer negotiation)

Did you try with Discord client? I used the Discord website in browser, that's where I tested WebRTC calling

Azuriye commented 2 years ago

Did you try with Discord client? I used the Discord website in browser, that's where I tested WebRTC calling

Which browser specifically? For some reason, Chrome does not work properly with WebRTC, tried all the remedies but just can't hear any audio from the Discord voice chat (same applies to any Chromium processes) only Firefox so far works fine with this setup of Proxifier + v2rayN.

ghost commented 2 years ago

Did you try with Discord client? I used the Discord website in browser, that's where I tested WebRTC calling

Which browser specifically? For some reason, Chrome does not work properly with WebRTC, tried all the remedies but just can't hear any audio from the Discord voice chat (same applies to any Chromium processes) only Firefox so far works fine with this setup of Proxifier + v2rayN.

Well like I said I use Edge browser, default Windows 11/10 browser, even though it's based on Chromium engine, it works fine with WebRTC over Socks5 proxy. in V2rayN I use Trojan TLS

image

also in V2rayN taskbar icon make sure it doesn't change system proxy

image

Azuriye commented 2 years ago

Did you try with Discord client? I used the Discord website in browser, that's where I tested WebRTC calling

Which browser specifically? For some reason, Chrome does not work properly with WebRTC, tried all the remedies but just can't hear any audio from the Discord voice chat (same applies to any Chromium processes) only Firefox so far works fine with this setup of Proxifier + v2rayN.

Well like I said I use Edge browser, default Windows 11/10 browser, even though it's based on Chromium engine, it works fine with WebRTC over Socks5 proxy. in V2rayN I use Trojan TLS

image

also in V2rayN taskbar icon make sure it doesn't change system proxy

image

I use VLESS XTLS (X-ray core), for some reason with Chrome or MS Edge even when I join a server I don't get that static robot glitchy voice and instead it's mute, the same does not happen with Firefox or Discord'a client app without VPN I hear those static voices but with VPN it goes away.

xyanrch commented 2 years ago

Maybe you can use tun2socks to proxy all udp and tcp traffic. In serverside I use overplus which is a optimized trojan protocol server, It works well with me.

In client side, setup tun2socks redirect all traffic to local trojan client such as v2rayN. Detailed info maybe you can refer here Route table:

route v2rayN
Azuriye commented 11 months ago

Hello again, after some research, I came up with nekoray. It isn't as good as NetchX and has many issues such as DNS Hijacking, etc. which doesn't make this a split tunnelling solution for Windows. The author warned that the Whitelist mode isn't like the Process mode in NetchX, but are there any alternatives to NetchX? it's currently disbanded in rework for NetchX 2.0.

EDIT: Both nekoray and sing-box are good solutions temporarily. Sing-box if your willing to go through the documentation or nekoray if you want sort of a plug and play option.