Posts

Post not yet marked as solved
8 Replies
562 Views
I am trying to set up an HTTP proxy that can be used system-wide from an app. After some research, it looks like the CoreFoundation library's CFNetworkExecuteProxyAutoConfigurationScript() function can be used to configure the proxy. (1) Is it possible to set the HTTP proxy available system-wide with CFNetworkExecuteProxyAutoConfigurationScript()? (2) I tried the following source code but "EXC_BAD_ACCESS" occurs and the callback block is not called. Do you know what is the problem? (void)startNextRequest { Request *request = _requests.firstObject; if (request == nil) { return; } CFStreamClientContext context; memset(&context, 0, sizeof(CFStreamClientContext)); context.info = (__bridge void * _Null_unspecified)(self); CFRunLoopSourceRef rls = CFNetworkExecuteProxyAutoConfigurationScript( (__bridge CFStringRef _Nonnull)(_script), (__bridge CFURLRef _Nonnull)(request.targetURL), (__bridge void *)^(PACResolver *client, CFArrayRef proxies, CFErrorRef error) { [client resolveDidFinishWithProxies:proxies error:error]; }, &context); assert(_runLoopSource == nil); _runLoopSource = rls; CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode); } Environment: Xcode 13.1 iPad 8th gen. iOS 14.0.1
Posted Last updated
.
Post not yet marked as solved
0 Replies
195 Views
When setting DNS in the app using the saveToPreferencesWithCompletionHandler method of NEDNSSettingsManager   (1) After setting in the app, the user needs to manually select the set DNS in Settings App -> General -> VPN & Network -> DNS. Is there a way to do this automatically in the app?   (2) Besides the above, is there any other way to automatically configure system-wide DNS from the app?   Environment : iPad 8th Gen. iOS 14.0.1 Xcode 13.1
Posted Last updated
.