Post

Replies

Boosts

Views

Activity

NetworkExtension,VPN 设置应用app白名单时不生效
My purpose is that after I connect to the VPN, my application request traffic does not go through the VPN service channel, and other apps or browsers request the VPN service My Settings are as follows 1: Configure config when creating NETunnelProviderManager NETunnelProviderProtocol *protocol = [[NETunnelProviderProtocol alloc] init]; NEProxySettings *proxySetting = [[NEProxySettings alloc] init]; proxySetting.excludeSimpleHostnames = YES; proxySetting.autoProxyConfigurationEnabled = NO; proxySetting.proxyAutoConfigurationURL = nil; proxySetting.autoProxyConfigurationEnabled = NO; proxySetting.HTTPSEnabled = YES; proxySetting.HTTPEnabled = YES; proxySetting.exceptionList = @[@"com.object_1", @"com.object_1.PacketTunnel"]; protocol.proxySettings = proxySetting; protocol.proxySettings = proxySetting; [NETunnelProviderManager new].protocolConfiguration = protocol code-block 2: Go to the network Settings in the extended callback - (void)openVPNAdapter:(OpenVPNAdapter *)openVPNAdapter configureTunnelWithNetworkSettings:(NEPacketTunnelNetworkSettings *)networkSettings completionHandler:(void (^)(id< OpenVPNAdapterPacketFlow> _Nullable))completionHandler { __weak __typeof(self) weak_self = self; // Try to filter networkExtension NEProxySettings *proxySetting = [[NEProxySettings alloc] init]; proxySetting.autoProxyConfigurationEnabled = NO; proxySetting.HTTPEnabled = YES; proxySetting.HTTPSEnabled = YES; proxySetting.excludeSimpleHostnames = YES; proxySetting.exceptionList = @[@"com.object_1", @"com.object_1.PacketTunnel"]; networkSettings.proxySettings = proxySetting; [self setTunnelNetworkSettings:networkSettings completionHandler:^(NSError * _Nullable error) { if(! error){ completionHandler(weak_self.packetFlow); }}]; } code-block Neither of these Settings is working as intended Verification method: Check whether the IP addresses before and after the VPN connection are the same. If the IP addresses are the same, the VPN service traffic is filtered out
0
0
905
Mar ’23
NetworkExtension,VPN 设置应用app白名单时不生效
My purpose is that after I connect to the VPN, my application request traffic does not go through the VPN service channel, and other apps or browsers request the VPN service My Settings are as follows 1: Configure config when creating NETunnelProviderManager NETunnelProviderProtocol *protocol = [[NETunnelProviderProtocol alloc] init]; NEProxySettings *proxySetting = [[NEProxySettings alloc] init]; proxySetting.excludeSimpleHostnames = YES; proxySetting.autoProxyConfigurationEnabled = NO; proxySetting.proxyAutoConfigurationURL = nil; proxySetting.autoProxyConfigurationEnabled = NO; proxySetting.HTTPSEnabled = YES; proxySetting.HTTPEnabled = YES; proxySetting.exceptionList = @[@"com.object_1", @"com.object_1.PacketTunnel"]; protocol.proxySettings = proxySetting; protocol.proxySettings = proxySetting; [NETunnelProviderManager new].protocolConfiguration = protocol code-block 2: Go to the network Settings in the extended callback - (void)openVPNAdapter:(OpenVPNAdapter *)openVPNAdapter configureTunnelWithNetworkSettings:(NEPacketTunnelNetworkSettings *)networkSettings completionHandler:(void (^)(id< OpenVPNAdapterPacketFlow> _Nullable))completionHandler { __weak __typeof(self) weak_self = self; // Try to filter networkExtension NEProxySettings *proxySetting = [[NEProxySettings alloc] init]; proxySetting.autoProxyConfigurationEnabled = NO; proxySetting.HTTPEnabled = YES; proxySetting.HTTPSEnabled = YES; proxySetting.excludeSimpleHostnames = YES; proxySetting.exceptionList = @[@"com.object_1", @"com.object_1.PacketTunnel"]; networkSettings.proxySettings = proxySetting; [self setTunnelNetworkSettings:networkSettings completionHandler:^(NSError * _Nullable error) { if(! error){ completionHandler(weak_self.packetFlow); }}]; } code-block Neither of these Settings is working as intended Verification method: Check whether the IP addresses before and after the VPN connection are the same. If the IP addresses are the same, the VPN service traffic is filtered out
Replies
0
Boosts
0
Views
905
Activity
Mar ’23