Re: Can CFReadStream use proxy set in the system configuration automatically?
site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists.... At 13:27 +0800 19/3/09, µÀéuº· wrote: Some one tell me that when using CFReadStream to query http, I don't have to care the proxy set in system configuration. Because CFReadStream can use the proxy set in system configuration. But I can't find the related description in the document. Can anyone tell me the fact? CFStream will not automatically pick up the proxy settings. If you want to use the system-defined proxy settings, you have to get the settings from the system (more on this below) and apply them using various stream properties (for example, kCFStreamPropertySOCKSProxy and kCFStreamPropertyHTTPProxy). To get the system proxy settings, you should use one of three different techniques: o In Mac OS X 10.5 and later, or iPhone OS, the best approach is to use CFNetworkCopyProxiesForURL. o If you don't have a URL handy, then on iPhone OS you can call CFNetworkCopySystemProxySettings to get the raw proxy settings. o On Mac OS X, prior to 10.5, or if you don't have a URL handy, you can use SCDynamicStoreCopyProxies. This email sent to site_archiver@lists.apple.com
participants (1)
-
Quinn