Urgent.News

What's breaking now, across thousands of outlets.

Tech

One Browser per Country: Running Several VPN Locations Simultaneously

Introduction There is always a case where I would like to use a VPN in order to browse some sites from other countries: it could be because I am comparing prices, looking at local products and other reasons. However, I do have numerous other tabs currently open and with work in progress. These would get disrupted if a computer network-wide VPN is used which switches the country for all processes…

Introduction

There are circumstances where using a VPN can be beneficial, such as comparing prices or viewing local products from different countries. However, if a computer network-wide VPN is employed, it can disrupt ongoing work by switching the country for all processes on the computer. Most common VPN applications provide network-wide functionality, which is not desirable in this situation.

Scenario

Let's consider an abstract scenario where one wants to have three browser windows open simultaneously, each in a different country: Poland, Germany, and the Netherlands. Currently, normal browser applications are tied to a single home connection and cannot support this requirement.

Solution

A potential solution involves creating a small router using Docker, which can be set up with multiple VPNs. This approach would involve building a series of sandboxes, each representing a VPN connection to a specific country. Each sandbox would have its own local proxy port. A browser, command-line tool, or any other application can then utilize a sandbox by pointing it at the corresponding port. With this setup, it is possible to run multiple countries in parallel on a single laptop.

Design

The proposed design consists of the following components:

1. One container: Each container runs a Gluetun program, which connects to a VPN provider and offers proxies to other programs.

2. One proxy: Each sandbox includes an HTTP proxy port and a SOCKS5 proxy port.

3. One browser profile: Each browser instance has its own profile, containing cookies, history, logins, and settings. Multiple profiles do not share data.

4. One browser instance: Each running copy of a browser application is considered a separate instance. Each instance has its own profile and proxy.

Traffic Flow

When a request is made, the traffic follows a specific path, moving through the proxy and passing through the VPN server. The IP address seen by the website will be the VPN server's address, not the user's home address.

Problems and Limitations

Several challenges can arise in this setup:

1. Dead server: If a VPN server goes offline, it may disrupt the connection for the corresponding country.

2. Rate limits: Some VPN providers impose rate limits on the number of simultaneous connections, which could affect the performance of the setup.

3. Shared IP addresses: If multiple users share the same VPN server location, the IP address may not be unique to the user.

4. Incorrect country assignment: In some cases, the DNS server may provide an incorrect country assignment for the IP address, leading to inaccurate geolocation data.

Conclusion

While running multiple VPN connections simultaneously on a single computer can be achieved through a custom setup using Docker, Gluetun, and multiple browser profiles, there are several limitations and challenges to consider. The proposed solution provides a flexible and isolated environment for browsing from different countries, but users should be aware of the potential issues and monitor the performance of their setup. The complete code for this implementation can be found on GitHub.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Ubuntu / Kubuntu 26.04 — Prefer GNU coreutils

GNU coreutils or uutils coreutils? Ubuntu 26.04 ships with both. I prefer to use the GNU coreutils, for several reasons: The uutils are written in Rust and therefore make use of the Rust/Cargo…

  • Ubuntu 26.04 includes both GNU and uutils coreutils packages
  • Author prefers GNU coreutils due to supply chain attack concerns
  • Instructions provided to switch to GNU coreutils on work machines

More from Tuesday 20 October →