This is a C translation that answers :
CFDictionaryRef proxies = SCDynamicStoreCopyProxies(NULL); if (proxies) { CFStringRef pacURL = (CFStringRef)CFDictionaryGetValue(proxies, kSCPropNetProxiesProxyAutoConfigURLString); if (pacURL) { char url[257] = {}; CFStringGetCString(pacURL, url, sizeof url, kCFStringEncodingASCII);
It must be associated with two structures: SystemConfiguration and CoreFoundation.
Please note that this code gets the URL to automatically configure the proxy server ( kSCPropNetProxiesProxyAutoConfigURLString ), if any. There are several other possible proxies. HTTP proxy or HTTPS proxy. For a list of all possible proxy servers, see SCSchemaDefinitions Link .
user557219
source share