Skip to content

Auto Reconnect

Trapdoor automatically reconnects when the connection drops.

How It Works

If your connection is interrupted (network issues, server restart, etc.), Trapdoor will:

  1. Detect the disconnection instantly
  2. Attempt to reconnect immediately
  3. Use exponential backoff if retries fail
  4. Restore your tunnel with the same subdomain

Reconnect Timing

AttemptWait Time
1stInstant
2nd0.5 seconds
3rd1 second
4th2 seconds
5th4 seconds
...Max 30 seconds

The client will attempt up to 10 reconnections before giving up.

What You'll See

Connection lost. Reconnecting...
Reconnect attempt 1 failed: connection refused (retry in 0.5s)
Reconnect attempt 2 failed: connection refused (retry in 1s)
Reconnected successfully!

Tunnel established!
  Tunnel ID:  myapp
  Public URL: https://myapp.trapdoor.sh

Your Subdomain is Preserved

If you're using a custom subdomain (-name), it will be restored after reconnection. No need to update webhook URLs or share a new link.

Network Issues

Common causes of disconnection:

  • WiFi switching
  • VPN connect/disconnect
  • Laptop sleep/wake
  • Server maintenance

Trapdoor handles all of these automatically.

Manual Reconnect

If auto-reconnect fails, simply restart the client:

bash
trapdoor -port 3000 -name myapp