Skip to content

Feature Request: Add VPN Network Interface Check / Kill-Switch to prevent IP leaks #164

Description

@UditThakkar

Is your feature request related to a problem? Please describe.

Currently, torlink relies on the underlying WebTorrent engine, which does not support binding traffic to a specific network interface (like NordLynx or tun0). If the VPN connection drops, the torrent client will failover to the default network adapter, leaking the user's real IP address to the swarm and search scraping sources.

Describe the solution you'd like

Add a configuration option vpnInterface (configurable in config.json or via a TORLINK_VPN_INTERFACE env var) that monitors the connection status of a specified interface:

  • Network Interface & Route Polling: Periodically inspect active default routes (0.0.0.0) on Windows (via route print 0.0.0.0) or check os.networkInterfaces() on macOS/Linux. Virtual adapters like NordLynx stay "Up" on the OS level when disconnected, so checking the routing table metric/gateway is required.
  • Auto-Pause/Kill-Switch: If the configured VPN interface drops, instantly remove active torrents from the download engine, disable HTTP search scraping, and display a prominent warning banner ([VPN Disconnected]) next to the logo.
  • Auto-Resume: Automatically re-add active downloads and seeds to the engine once the VPN interface reconnects.
  • TUI Selection Prompt: Bind a key (e.g., v) to display a dropdown selector of available network adapters for easy configuration.

Describe alternatives you've considered

  • OS-level Firewall Rules: Restricting the global node.exe process via Windows Defender Firewall is secure but blocks all other NodeJS applications on the system from accessing the internet when the VPN is down.
  • VPN Client App Kill-Switch: Terminates the entire node process when disconnected, which abruptly kills the TUI session.

Additional Context

I have already implemented this feature locally (including dynamic interface list dropdown inside the TUI, routing metric validations on Windows, and auto-resume logic). I'd be happy to open a Pull Request with the fix if this feature is wanted!

Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions