Mullvad Setup
odirscan requires an active Mullvad VPN connection to route scan requests through SOCKS5 proxies on Mullvad relay servers.
Prerequisites
- A Mullvad VPN subscription.
- The Mullvad client connected to a WireGuard server before starting odirscan.
Connection Check
At startup, Scanner.New() calls mullvad.IsConnected(), which makes a request to:
https://am.i.mullvad.net/json
The response includes a mullvad_exit_ip boolean field. If this is true, odirscan proceeds to start the relay list updater. If the check fails or the VPN is not connected, the program exits with a fatal error.
Relay List Updater
Once the VPN is confirmed active, StartUpdater() performs an initial fetch of the Mullvad relay list and then checks for updates on a configurable interval (default: 1 hour).
The updater:
- Sends an HTTP HEAD request to the relay API endpoint to check
ETagandLast-Modifiedheaders. - Compares against locally cached metadata (
relays.meta.json). - If the remote list is newer (or no local copy exists), downloads the full relay list to
relays.json. - Parses the relay list into memory for proxy selection.
Subsequent checks run in a background goroutine.