Skip to content

affectioned/mullvad_server_picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mullvad server picker

Measures latency to Mullvad WireGuard relays and ranks the best one to connect to. It pings each relay's entry IP directly (works while disconnected), then scores by:

score = avg_latency + 2·jitter + 8·loss%   (lower is better)

Jitter and packet loss are weighted heavily because they're the tell-tale signs of an overloaded server — the thing that makes downloads crawl and ping spike even when a server looks geographically close.

Requirements

  • Python 3.8+ (standard library only — no pip install needed)
  • The system ping command (built in on Windows, macOS, and Linux)
  • The Mullvad CLI on PATH — only needed to actually connect; ranking works without it

Runs on Windows, macOS, and Linux — every platform Mullvad supports. The tool auto-detects the OS and uses the correct ping invocation for each.

Usage

# Disconnect first for accurate numbers, then:
mullvad disconnect

python pick.py                          # ping every relay, show top 10
python pick.py --country us             # only US relays
python pick.py --country us --city nyc  # only New York
python pick.py --top 20                 # show more results
python pick.py --list-countries         # valid country / city codes
python pick.py --daita                  # only DAITA-capable relays
python pick.py --refresh                # re-download the relay list
python pick.py --json                   # machine-readable output

The tool prints a ranked table and the exact mullvad relay set location / mullvad connect commands for the winner.

Why disconnect first?

While connected, every ping travels through your current tunnel, so all relays look equally far away and the ranking is meaningless. The tool warns you if it detects an active connection.

Options

Flag Description
--country, -c Country code filter (e.g. us, se, de)
--city City code filter (e.g. nyc, sto)
--provider Substring match on hosting provider
--owned Only Mullvad-owned relays
--daita Only DAITA-capable relays
--top, -n Number of results to show (default 10)
--count Pings per relay (default 4)
--timeout Per-ping timeout in ms (default 1000)
--workers Concurrent pings (default 80)
--all Include inactive relays too
--refresh Force re-download of the relay list
--json JSON output

Relay data comes from https://api.mullvad.net/app/v1/relays and is cached locally for 24 hours (relays_cache.json).

License

MIT

About

Measure latency to Mullvad WireGuard servers and rank the fastest, least-loaded one to connect to — cross-platform CLI (Windows/macOS/Linux).

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages