Re: Can CFReadStream use proxy set in the system configuration automatically?
Re: Can CFReadStream use proxy set in the system configuration automatically?
- Subject: Re: Can CFReadStream use proxy set in the system configuration automatically?
- From: Quinn <email@hidden>
- Date: Thu, 19 Mar 2009 10:57:37 +0000
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.
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden