Network Protection
Kill Switch
The kill switch controls what happens to network traffic when the VPN tunnel is not active. It is enforced by the daemon's firewall — the library only selects the mode.
await vpn.SetKillSwitchModeAsync(KapeKillSwitchMode.Standard);
vpn.KillSwitchMode // the current setting
KapeKillSwitchMode | Behaviour |
|---|---|
Off | Traffic continues over the regular internet if the tunnel drops |
Standard | Traffic is blocked when the tunnel disconnects unexpectedly; allowed when deliberately disconnected |
Advanced | All traffic is blocked unless the tunnel is active, including during intentional disconnections |
The setting persists in the daemon and applies immediately.