Reputation: 11
I'm using Amnesia WG VPN on a VDS server and want to configure my VPN to work only through my browser, similar to how VPN extensions operate (e.g., for Chrome or Firefox). The idea is that the rest of my system traffic doesn't go through the VPN—only the browser does. I want to use my own Amnesia WG configuration, not a third-party VPN provider.
I've considered the following options but haven't found a complete solution yet:
Brave Browser VPN: Brave has built-in VPN functionality but uses its own infrastructure rather than custom configs
Outline VPN: Outline can run VPN via the browser, but also requires managing separate servers
OpenConnect: This is configurable for HTTPS-based VPNs, but doesn’t seem to easily adapt for Amnesia WG or browser-only routing
Does anyone have experience or insight on setting up WireGuard/Amnesia WG for browser-only traffic? Ideally, I'd like to keep my config but emulate the functionality of a VPN browser extension. Any suggestions on specific software, browser settings, or scripts that could help would be appreciated!
Upvotes: 1
Views: 1268
Reputation: 81
wireproxy-awg approach
If you are using Linux or macOS, you can achieve this using the wireproxy-awg project (a fork of WireProxy with support for AmneziaWG).
This tool establishes a connection to the VPN server and sets up a SOCKS proxy server. Any connections made through this SOCKS server will be routed via the VPN server. To utilize this, you can use the Proxy SwitchyOmega browser extension or similar tools. Alternatively, you can configure your browser's built-in proxy settings.
Unfortunately, there is no client available for Windows.
AmneziaVPN built-in SOCKS server approach
As an alternative (though it didn't work for me), you can try enabling the SOCKS5 server in the "Services" tab of your VPN in Amnezia. When the Amnezia VPN connection is active, the SOCKS5 server should be operational. You can test it with a curl command like this:
curl --socks5 proxy_user:[email protected]:12345 ifconfig.me
However, once the proxy connection is active, all traffic goes through the VPN by default. I attempted to use split tunneling to route only traffic destined for my VPN server through the VPN connection, leaving everything else to bypass it. Unfortunately, this approach did not work for me.
Upvotes: 0