Okay, if setting your proxy settings from Proxy Settings via System Preferences -> Proxies -> Automatic Proxy Configuration does work, then can you try extracting these settings using the
SCDynamicStore APIs and setting them to your proxy settings in your Network System Extension?
Code Block swiftlet settings = NETransparentProxyNetworkSettings(tunnelRemoteAddress: "x.x.x.x") |
|
let proxySettings = NEProxySettings() |
|
guard let sysConf = SCDynamicStoreCopyProxies(nil) as? [CFString: AnyObject] else { |
return nil |
} |
proxySettings.autoProxyConfigurationEnabled = sysConf[kSCPropNetProxiesProxyAutoConfigEnable] as? Bool ?? false |
proxySettings.proxyAutoConfigurationURL = sysConf[kSCPropNetProxiesProxyAutoConfigURLString] as? String |
proxySettings.proxyAutoConfigurationJavaScript = sysConf[kSCPropNetProxiesProxyAutoConfigJavaScript] as? String |
/* Additional proxy settings */ |
|
settings.proxySettings = proxySettings |
If this does not work, try hardcoding some of your proxy settings as a test. This is not something you should deploy, but this should work as a test to see if these values are picked up for specific flows that match your proxy settings in your PAC file. For example, try hard coding a URL to your PAC file and if your flows fall within range that match your PAC file then you should see the remoteEndpoint reflect this when handed off to your provider in
handleNewFlow. If that does not work then it could indicate an issue with your project configuration.
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com