Reputation: 11
I was reading about the VPN On Demand feature built on the latest versions of iOS.
The problem here is:I run vpn in my app, other app can use the vpn traffic. Now,I hope that only some domain names can use vpn, such as only google.com,other normal.
NEVPNProtocolIPSec *protocol = [[NEVPNProtocolIPSec alloc] init];
... other setting ...
NEProxySettings* setting = [NEProxySettings new];
setting.excludeSimpleHostnames = YES;
setting.HTTPSEnabled = YES;
setting.HTTPEnabled = YES;
setting.autoProxyConfigurationEnabled = YES;
NSMutableArray *blackList = [NSMutableArray new];
[setting setExceptionList:blackList];
NSArray *whiteList = @[@"google.com"];
[setting setMatchDomains:whiteList];
[protocol setProxySettings: setting];
But it did not work. Please any HELP!
Upvotes: 1
Views: 285