I'm coding an iPhone app that needs to make small HTTP requests to the Internet. Within our corp LAN, all HTTP traffic has to go through Squid.
The simulator is clearly capable of using a proxy - since Mobile Safari works. But, how do I get/set the proxy settings in code?
A bunch of the headers are commented out for the simulator. For example,
CFNetworkCopySystemProxySettings
In CFProxySupport.h is not available to the simulator - only to the device. I've tried hardcoding like this:
CFReadStreamSetProperty(stream, kCFProxyHostNameKey, @"internal.proxy.servername");
CFReadStreamSetProperty(stream, kCFProxyPortNumberKey, [NSNumber numberWithInt:80]);
CFReadStreamSetProperty(stream, kCFProxyTypeKey, kCFProxyTypeHTTP);
But no joy.
Thoughts?