VPN only in browser

Here’s what I want: I have a VPS with a static public IP. I want to route my connections only on a particular web browser (could be any browser, I am willing to switch - this will be on a different computer, not the server) with the connection of that VPS. What do I install on the VPS and the browser?

This can be super easy if it’s just one browser profile. In a terminal, run

ssh -f -N -D1080 <your_vps>

(this presumes that you have sshd running on the VPS and the port is open, but since that’s the most default and most sane way to connect to your VPS, I’m guessing it’s already set up that way.)

And then configure your browser to connect to the internet using a SOCKS proxy at localhost:1080. Look in the browser’s settings for network settings, or similar.

Don’t forget to also configure the browser to proxy DNS over SOCKS.

If the SSH connection is severed, you’ll start getting “The proxy server is refusing connections” messages (which is what you want; you don’t want to seemlessly fall back to direct connection without knowing about it), and if you do start getting those messages, just re-run the ssh command.

You might have all that you need already. Look into how to configure the browser to use a SOCKS 5 proxy, then look at how to enable the SOCKS proxy in ssh (-D option).

use “split tunneling”. you can use “TunnlTo” wireguard client on Windows to only allow VPN traffic for specific apps.