Skip to main content

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
KapeKillSwitchModeBehaviour
OffTraffic continues over the regular internet if the tunnel drops
StandardTraffic is blocked when the tunnel disconnects unexpectedly; allowed when deliberately disconnected
AdvancedAll traffic is blocked unless the tunnel is active, including during intentional disconnections

The setting persists in the daemon and applies immediately.