🎖️ Gaming with v2rayN (or any other VLESS proxy)
I have been using XRay + VLESS proxy for a long time without any problems until recently. With the TUN mode enabled and process filtering configured inside v2rayN (or Nekoray), it was sufficient to satisfy daily routine web surfing. Everything went well until Discord was blocked in Russia.
While there were no problems with Discord itself (always should be easy to configure if your proxy is UDP-compatible, like XRay + VLESS + v2rayN combination), some other applications appear to be broken when the TUN mode is enabled. For me, it’s only games that are affected, but I’ve heard it also breaks other specific processes. Here are some known examples: Hunt: Showdown, Valorant, Lost Ark (tested it myself), etc.
This makes it unstable to use process filtering and the TUN mode to proxify Discord while playing non-proxified game. The latter will simply not work (or it will, but with problems or some functionality unavailable).
What’s wrong exactly
Firstly, let’s see what TUN is according to Wikipedia:
TUN, namely network TUNnel, simulates a network layer device and operates in layer 3 carrying IP packets. TAP, namely network TAP, simulates a link layer device and operates in layer 2 carrying Ethernet frames. TUN is used with routing. TAP can be used to create a user space network bridge.
In short, when you use the TUN mode in v2rayN, it creates a virtual interface that now receives all the traffic and then decides whether to proxy it or send it directly. Even if your rules aren’t proxying your game’s traffic, it still goes through a virtual interface, which likely increases latency, causes drops and undefined behavior depending on the game’s implementation details.
A game could be incompatible with the TUN mode for various reasons. One such reason, which I noticed in Hunt: Showdown, is the inability to correctly ping servers. It’s known that you can’t ping behind a proxy, and when the TUN mode is enabled, as mentioned above, everything goes through a proxy even if your rules don’t actually proxy it (although I’m not sure whether this is really the reason for 0ms ping, or if it’s just because the TUN code is poorly written).
So, summing up, to avoid disrupting your gaming experience, you should avoid enabling the TUN mode during your gaming session.
Life without TUN mode
Let’s examine some concrete case: I need to proxy Discord, which is blocked in my country, using v2rayN on Windows. This must be done without the TUN mode to not break the game that I’m running at the same time.
Several options are available.
Set proxy for Discord at application-level
Why at all do we need the TUN mode to proxy Discord? Perhaps because it’s much easier to do than specify a proxy at the application level. On OSX or Linux you can simply pass the --proxy-server
parameter, but on Windows, you have to use more complicated solutions.
I tried some of these, but only one actually worked for me. All of these inject custom DLLs to Discord process, so no third-party software is needed:
- runetfreedom/discord-voice-proxy - this one worked for me.
- aiqinxuancai/discord-proxy and hdrover/discord-drover - both looks pretty much the same, but probably they’re a bit outdated because my Discord installation doesn’t have
version.dll
file at all, probably that’s why they didn’t work for me.
Use third-party software to route traffic
If you’re unable to set a proxy at the application level, you can try using some third-party software to achieve the same results.
Several options are also available here:
- wiresock/proxifyre - partially open-source, works, but a little bit non-user-friendly: configuration via
.json
, no GUI, no installer. Also requires Windows Packet Filter driver to be installed. - ProxyCap - paid, works, but breaks some applications and requires additional actions to fix them (see their FAQ, question “WSL stops working after installing ProxyCap”).
- Proxifier - paid and isn’t suitable fully because it doesn’t support UDP.
Conclusion
That way you can get rid of the TUN mode to not break your gaming experience. One or another option should be suitable for any application, not just Discord. See also my note 🪟 Mastering Windows performance for additional gaming improvements. Good luck on the battlefield!
Thank you for reading this little article, I hope it will be useful to someone. Feel free to reach me if you have something to say.
And also take a look on the posts on similar topics: