No description
Find a file
Thorsten Schubert 086106da30
All checks were successful
/ build (push) Successful in 44s
Add verbose output
2024-05-08 20:18:43 +02:00
.forgejo/workflows Establish basic workflow 2024-04-19 02:08:56 +02:00
.gitignore Establish basic workflow 2024-04-19 02:08:56 +02:00
CHANGELOG.md Establish basic workflow 2024-04-19 02:08:56 +02:00
go.mod Add verbose output 2024-05-08 20:18:43 +02:00
go.sum Add verbose output 2024-05-08 20:18:43 +02:00
justfile Establish basic workflow 2024-04-19 02:08:56 +02:00
LICENSE Pack structs for minimal memory usage 2023-09-21 19:25:35 +02:00
main.go Add verbose output 2024-05-08 20:18:43 +02:00
README.md Pack structs for minimal memory usage 2023-09-21 19:25:35 +02:00

mullvad-best-server

status-badge

Determines the mullvad.net server with the lowest latency concurrently.

Installation

No pre-compiled binary is supplied at the moment.

From source

  • Clone repository
  • make build or go build -ldflags="-s -w" .

Usage

When executing mullvad-best-server it will retrieve a list of mullvad servers from the public API and issue ICMP packets to determine the server with the lowest latency. It then outputs the server code, e.g. de05 on success.

Command line parameters

Usage of mullvad-best-server:
  -api-timeout duration
    	API timeout (default 10s)
  -country string
    	Relay country code (ISO 3166 ALPHA-2), e.g. 'de' for Germany
  -interval duration
    	Packet interval (default 200ms)
  -json
    	Output result as JSON
  -log string
    	Log level. Allowed values: trace, debug, info, warn, error, fatal, panic (default "warn")
  -packets int
    	Number of packets per relay (default 16)
  -provider string
    	Relay provider, e.g. 31173 for mullvad owned relays
  -rtt string
    	Minimum (min) or Average (avg) time for RTT latency (default "avg")
  -threads int
    	Number of relays processed concurrently (batch) (default 32)
  -timeout duration
    	Ping timeout (default 200ms)
  -warmup
    	Warmup phase (default true)

If you want the full server information, execute mullvad-best-server -json, it returns the full JSON server object.

Background

The program uses https://api.mullvad.net/www/relays/<SERVER_TYPE>/ to get the current server list, filters them by the supplied arguments and outputs the server with the lowest latency.

Example

Using the official Mullvad CLI

mullvad relay set location "$(mullvad-best-server -country de -provider=31173 -warmup)" \
  && mullvad connect