add readme and license

This commit is contained in:
Jeffrey Paul 2024-06-09 08:50:28 -07:00
parent 20d4f1bdc7
commit 4dd5e871f8
2 changed files with 164 additions and 0 deletions

14
LICENSE Normal file
View File

@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

150
README.md Normal file
View File

@ -0,0 +1,150 @@
# mullvadclosest
A small golang program that checks your latency to all of the known mullvad
relays.
This will use your local relay database as installed by the mullvad client
if it finds it. Otherwise, it will use a bundled copy which may be a bit
out of date. If that happens, contact me and I'll update it.
This will show you the top 25 lowest latency relays (VPN servers) to you,
and the 5 highest for comparison.
# Errata
The go ICMP ping library I'm using doesn't work on OSX if you're not root, so the
program requires it. Oh well.
# Usage
Make sure you're **disconnected** from the VPN when you run this. It needs
to be able to ping the relays directly, and if you're connected to the VPN
you'll get the latency through the VPN server to which you're connected,
which is not what you want.
Run:
```
GOPROXY=direct sudo go run sneak.berlin/go/mullvadclosest/cmd/mullvadclosest@latest
```
(The GOPROXY=direct means to download the code directly from my servers, not
the Google-operated golang module proxy. Given that you're running this
program as root from a random place on the internet, downloading it directly
from me avoids the case where Google can serve you arbitrary code that runs
on your machine.)
# Example output
Run from the southwestern US:
```
root@bastion:~# GOPROXY=direct go run sneak.berlin/go/mullvadclosest/cmd/mullvadclosest@latest
Checking liveness 100% |███████████████████████████████████████████████████████████████████████████████████████████████| (684/684, 78 it/s)
Measuring latency 100% |███████████████████████████████████████████████████████████████████████████████████████████████| (673/673, 7 it/s)
Total relays: 684
Live relays: 673
Dead relays: 11
Min latency: 11.240837ms (Relay(hostname=us-lax-wg-203, ip=169.150.203.28, country=USA))
Max latency: 351.145942ms (Relay(hostname=sg-sin-wg-002, ip=138.199.60.15, country=Singapore))
Median latency: 152.235439ms (Relay(hostname=de-fra-wg-106, ip=146.70.117.34, country=Germany))
Mean latency: 122.094918ms
Stddev latency: 63.354381ms
Country City Hostname Latency
USA Los Angeles, CA us-lax-wg-203 11.240837ms
USA Los Angeles, CA us-lax-wg-303 11.414964ms
USA Los Angeles, CA us-lax-ovpn-201 11.575832ms
USA Los Angeles, CA us-lax-wg-404 12.160305ms
USA Los Angeles, CA us-lax-wg-102 12.189879ms
USA Los Angeles, CA us-lax-ovpn-402 12.37345ms
USA Los Angeles, CA us-lax-wg-403 12.724075ms
USA Los Angeles, CA us-lax-wg-401 12.802629ms
USA Los Angeles, CA us-lax-ovpn-202 13.044014ms
USA Los Angeles, CA us-lax-wg-202 13.129124ms
USA Los Angeles, CA us-lax-wg-406 13.655117ms
USA Los Angeles, CA us-lax-wg-302 13.804244ms
USA Los Angeles, CA us-lax-wg-501 13.854577ms
USA Los Angeles, CA us-lax-wg-502 14.668269ms
USA Los Angeles, CA us-lax-br-401 15.198631ms
USA Los Angeles, CA us-lax-wg-405 15.47022ms
USA Los Angeles, CA us-lax-ovpn-102 15.764457ms
USA Los Angeles, CA us-lax-wg-503 15.918306ms
USA Los Angeles, CA us-lax-ovpn-401 16.264245ms
USA Los Angeles, CA us-lax-wg-103 16.35017ms
USA Los Angeles, CA us-lax-wg-201 16.469779ms
USA Los Angeles, CA us-lax-ovpn-101 16.655777ms
USA Los Angeles, CA us-lax-ovpn-403 17.289434ms
USA Los Angeles, CA us-lax-wg-402 18.19131ms
USA Los Angeles, CA us-lax-wg-101 18.290308ms
South Africa Johannesburg za-jnb-wg-001 288.186466ms
Singapore Singapore sg-sin-wg-001 342.030852ms
Singapore Singapore sg-sin-wg-003 346.614045ms
Singapore Singapore sg-sin-wg-002 351.145942ms
```
Run from an LTE connection in Türkiye:
```
akrotiri:~$ GOPROXY=direct sudo go run sneak.berlin/go/mullvadclosest/cmd/mullvadclosest@latest
Checking liveness 100% |███████████████████████████████████████████████████████████████████████████████████████████| (684/684, 25 it/s)
Measuring latency 100% |███████████████████████████████████████████████████████████████████████████████████████████| (602/602, 5 it/s)
Total relays: 684
Live relays: 602
Dead relays: 82
Min latency: 87.088ms (Relay(hostname=nl-ams-ovpn-003, ip=185.65.134.73, country=Netherlands))
Max latency: 560.733ms (Relay(hostname=th-bkk-wg-001, ip=156.59.50.194, country=Thailand))
Median latency: 155.925ms (Relay(hostname=gr-ath-wg-101, ip=149.102.246.2, country=Greece))
Mean latency: 175.519705ms
Stddev latency: 84.258738ms
Country City Hostname Latency
Netherlands Amsterdam nl-ams-ovpn-003 87.088ms
Netherlands Amsterdam nl-ams-wg-006 87.523ms
Netherlands Amsterdam nl-ams-wg-101 89.472ms
Netherlands Amsterdam nl-ams-wg-201 91.061ms
Netherlands Amsterdam nl-ams-ovpn-005 91.272ms
Netherlands Amsterdam nl-ams-wg-004 91.527ms
Belgium Brussels be-bru-wg-102 92.082ms
Netherlands Amsterdam nl-ams-ovpn-004 93.036ms
Belgium Brussels be-bru-wg-101 93.22ms
Germany Frankfurt de-fra-wg-004 94.146ms
Netherlands Amsterdam nl-ams-ovpn-001 94.465ms
Netherlands Amsterdam nl-ams-wg-007 94.578ms
Germany Frankfurt de-fra-ovpn-003 94.681ms
Germany Dusseldorf de-dus-wg-002 95.224ms
Netherlands Amsterdam nl-ams-wg-001 95.555ms
UK London gb-lon-wg-202 96.297ms
UK London gb-lon-wg-201 96.468ms
Germany Frankfurt de-fra-ovpn-006 96.544ms
Germany Frankfurt de-fra-wg-006 96.58ms
UK London gb-lon-ovpn-002 96.775ms
UK London gb-lon-wg-203 96.822ms
Germany Dusseldorf de-dus-wg-001 96.865ms
Belgium Brussels be-bru-ovpn-101 96.869ms
UK London gb-lon-ovpn-301 96.922ms
UK London gb-lon-ovpn-005 97.231ms
Australia Perth au-per-wg-302 438.455ms
Singapore Singapore sg-sin-ovpn-102 444.711ms
Indonesia Jakarta id-jpu-wg-002 504.1ms
Thailand Bangkok th-bkk-wg-001 560.733ms
```
# Author
sneak &lt;[sneak@sneak.berlin](mailto:sneak@sneak.berlin)&gt;
# License
[WTFPL](./LICENSE)
Do with it what you will. There is no warranty, express or implied,
including but not limited to merchantability or fitness for a particular
purpose. Use at your own risk. Maybe clone it and read the code before
you run random shit from some weirdo from the internet as root.
# Source
https://git.eeqj.de/sneak/mullvadclosest