Skip to content

Feature Request: Add Automatic VPN Tunnel Health Monitoring and Recovery #184

Backlog

Description

@Bartxter

Problem Description

VPN connections may sometimes become unresponsive after an internet connection loss, switching between Wi-Fi and mobile data, or waking the device from sleep.

In some cases, Throne may continue to show the VPN as connected even though traffic is no longer passing through the tunnel. The user then has to manually disconnect and reconnect the VPN to restore connectivity.

Keep-alive mechanisms alone may not be sufficient to detect and recover from every type of connection failure, especially when a tunnel becomes unresponsive or its underlying transport session is lost.

This issue may affect different tunnel types, including:

  • WireGuard
  • AmneziaWG
  • MASQUE over HTTP/2
  • MASQUE over HTTP/3 (QUIC)

Proposed Solution

Implement a general VPN tunnel health monitoring and automatic recovery mechanism (Watchdog) for Android.

The proposed behavior:

  1. Periodically check whether internet connectivity is actually available through the active VPN tunnel.
  2. Detect situations where Android reports the VPN as connected, but traffic through the tunnel is no longer working.
  3. Distinguish temporary network interruptions from a stalled or lost tunnel.
  4. Automatically restart or recreate the affected tunnel when a failure is confirmed.
  5. Retry failed connections using progressively longer intervals (exponential backoff).
  6. Trigger recovery when the underlying network changes (Wi-Fi ↔ mobile data).
  7. Preserve the Android VPN service whenever possible, restarting only the affected tunnel instead of requiring a complete VPN service restart.
  8. Resume normal operation automatically when internet connectivity becomes available again.

The health-check mechanism could be shared across supported protocols, while the actual recovery procedure should be implemented according to the requirements of each protocol and transport.

Suggested Settings

It would be useful to provide configurable options:

  • Enable or disable automatic recovery.
  • Health-check interval.
  • Number of consecutive failed checks before recovery is triggered.
  • Initial retry delay.
  • Maximum retry delay.

Expected Result

Throne should automatically detect and recover from VPN tunnel failures, including network interruptions, stalled connections, and network changes.

Users should not have to manually disconnect and reconnect the VPN to restore connectivity.

Environment

  • Android
  • Throne for Android
  • Affected tunnel types: WireGuard, AmneziaWG, and MASQUE (HTTP/2 and HTTP/3).

Thank you for your work on Throne!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions