Killswitch

Killswitch can be controlled by EnableKillSwitch property, also it can be turned on by StartVpn method

            var startVpnRequest = new StartVpnRequest
            {
                Credentials = getCredentialsResponse.Credentials,
                DeviceId = DEVICEID,
                EnableKillSwitch = true, //killswitch turned on
                EnableTunnelLogging = false,
                VpnNode = node,
            };

            var _ = sdk.StartVpn(startVpnRequest);
            sdk.EnableKillSwitch = false; //killswitch turned off

Killswitch can be used to prevent traffic leakage during an expected VPN tunnel shutdown. KeepKillSwitchEnabled property must be set to true, a subsequent call to the Disconnect() method will trigger killswitch

            sdk.KeepKillSwitchEnabled = true
            var startVpnRequest = new StartVpnRequest
            {
                Credentials = getCredentialsResponse.Credentials,
                DeviceId = DEVICEID,
                EnableKillSwitch = true, //killswitch turned on
                EnableTunnelLogging = false,
                VpnNode = node,
            };

            var _ = sdk.StartVpn(startVpnRequest);
            
            sdk.Disconnect();

Last updated