as per title, is there anyway to use the VPN connection on the browser only? alternativly, is there anyway to prevent a game from using VPN connection?
the Idea is, I wanna play a game on my normal connection and want to use the browser on the VPN connection without the game being affected
If you know the IP address(es) of the servers your game connect to then you can add a static route to those address via your default gateway. If the game is peer to peer then that’s not going to be practical.
Do you happen to be using multivad? If so, they provide a privacy focused version of Firefox with the VPN builtin to the browser.
There are a couple different projects that supposedly will connect to wireguard remote, and present a SOCKS connection that you could configure as a proxy in your browser. I haven’t directly used any of those.
You could setup a HTTP proxy on the server, and configure your browser to use it.
This will allow you to just add a static route to that one IP of the server, without hampering the routing logic.
However, there is a possibility of DNS leak, some browsers prefer to resolve the site’s address before sending the message to the Proxy, so you need to make sure that it does not happen accordingly.
Run the browser in a VM, then route the VM down wg.
not pretty,not efficient, but works.
Or run WireGuard in a VM/container together with a proxy server, then configure the address to that proxy server on any browser (which allows proxies).
For Firefox there is even a multi-account container extension which allows you to run multiple tabs with different proxy addresses at the same time. Which is useful in case you run multiple WireGuard VPNs.
There are prolly many other ‘browser in docker with vpn’
Addendum: If you go that route I would use Vivaldi to connect to the docker browser, Ctrl-F11 (with ‘Native window’ set)will completely remove the Vivaldi UI and make it look like you are just using mullvadBrowser/Firefox)