From a95212fcc810f202331ebe6a8a6ed77ed1b31bc7 Mon Sep 17 00:00:00 2001 From: Jeroen Leenarts Date: Thu, 16 Aug 2018 22:04:35 +0200 Subject: [PATCH] Add on demand rule. Signed-off-by: Jason A. Donenfeld --- WireGuard/Coordinators/AppCoordinator.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WireGuard/Coordinators/AppCoordinator.swift b/WireGuard/Coordinators/AppCoordinator.swift index fb28ec1..f49819a 100644 --- a/WireGuard/Coordinators/AppCoordinator.swift +++ b/WireGuard/Coordinators/AppCoordinator.swift @@ -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 {