Add on demand rule.

This commit is contained in:
Jeroen Leenarts 2018-08-16 22:04:35 +02:00
parent 6b57ca0d98
commit 11b43206ff
1 changed files with 4 additions and 1 deletions

View File

@ -241,7 +241,10 @@ extension AppCoordinator: TunnelConfigurationTableViewControllerDelegate {
protocolConfiguration.providerConfiguration = tunnel.generateProviderConfiguration()
manager.protocolConfiguration = protocolConfiguration
manager.onDemandRules = [NEOnDemandRuleConnect()]
let connectRule = NEOnDemandRuleConnect()
connectRule.interfaceTypeMatch = .any
manager.onDemandRules = [connectRule]
// manager.isOnDemandEnabled = true
manager.saveToPreferences { (error) in
if let error = error {