Auto Reconnect
Trapdoor automatically reconnects when the connection drops.
How It Works
If your connection is interrupted (network issues, server restart, etc.), Trapdoor will:
- Detect the disconnection instantly
- Attempt to reconnect immediately
- Use exponential backoff if retries fail
- Restore your tunnel with the same subdomain
Reconnect Timing
| Attempt | Wait Time |
|---|---|
| 1st | Instant |
| 2nd | 0.5 seconds |
| 3rd | 1 second |
| 4th | 2 seconds |
| 5th | 4 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.shYour 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