Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VPN Watchdog

VPN Watchdog

A Windows tray app that shuts down your torrent client the moment your VPN drops.

  • Sits in the notification area — no main window.
  • Green icon when protected, red when tripped, grey when disarmed.
  • Works with PIA, Mullvad, Proton, NordVPN, Surfshark, ExpressVPN, CyberGhost, Windscribe, IVPN, AirVPN, TorGuard, plus generic WireGuard/OpenVPN, auto-detect, or a specific adapter you pick.
  • Supports qBittorrent, Deluge, Transmission, uTorrent, BitTorrent, Tixati, Vuze, PicoTorrent, BitComet, or any process name you add.
  • Optionally restarts the client once the VPN has been stable again.
  • No admin rights, no services, no firewall changes.

Tray icon states: protected, tripped, disarmed
Protected  ·  tripped  ·  disarmed

Tray menu

How it detects a drop

Checking that the VPN adapter exists isn't enough. The dangerous case is an adapter that's up with a valid IP while Windows still routes your traffic out of the physical NIC — everything looks connected and nothing is protected.

So it asks Windows which interface it would use to reach the internet and requires that to be the VPN adapter. No packets are sent; it reads the routing table only. A missing adapter also counts as down, which is normal — WireGuard and OpenVPN adapters only exist while connected.

Install

  1. Download KillSwitch.exe from Releases.
  2. Run it. The icon appears in the notification area.
  3. Right-click it → Settings, pick your VPN provider and tick your torrent client.
  4. Enable Start with Windows on the last tab.

Nothing to install — it's a single file. Settings and logs go to %LOCALAPPDATA%\KillSwitch.

Test it before trusting it: start your torrent client, disconnect the VPN, and watch it close.

Settings

VPN tab Torrent clients tab
Pick your provider and confirm detection with a live check. Tick the clients to shut down, or auto-detect what's running.
Shutdown method tab Restart and general tab
Choose how the client is stopped. Auto-restart, start with Windows, logging.

Shutdown methods

Method Behaviour
Ask to close, then force (default) Requests a clean close, force-kills after the grace period
Force kill immediately Terminates at once; resume data may be lost
Web UI pause, then shut down Pauses torrents via the qBittorrent Web API, then exits cleanly

qBittorrent set to close to system tray ignores a close request, so the default becomes a force-kill after the grace period. Use the Web UI method if you want resume data reliably saved. It always falls back to force-killing if the Web UI can't be reached.

Build from source

Requires the .NET 10 SDK on Windows.

git clone https://github.com/esmith443/VPN-Watchdog.git
cd VPN-Watchdog
.\build.ps1

The executable lands in dist\KillSwitch.exe — self-contained, about 47 MB, runs on any Windows 10/11 x64 machine with no runtime installed.

For a much smaller binary that needs the .NET 10 Desktop Runtime installed:

.\build.ps1 -FrameworkDependent

Or build it directly without the script:

dotnet publish src\KillSwitch\KillSwitch.csproj -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -o dist

To regenerate the icons after changing assets\source-logo.png:

.\tools\build-icon.ps1

Troubleshooting

Right-click the tray icon → Save diagnostics report. It lists every adapter, which interface is carrying traffic, the current verdict and why, and any running torrent clients.

Limitations

  • Restarting a client relaunches the executable without its original command-line arguments.
  • Stopping a client running as another user, or elevated, needs the watchdog elevated too. If a client can't be stopped, the tray warns and the log records it rather than reporting success.
  • This kills the process; it doesn't block traffic at the network layer. There's a sub-second window between the drop and the process dying. Binding the client to the VPN adapter in its own settings (qBittorrent: Options ▸ Advanced ▸ Network interface) closes that gap and complements this.

About

Windows tray app that shuts down your torrent client the moment your VPN drops. Verifies the tunnel actually carries traffic, not just that the adapter exists.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages