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?
It should be set to off if you don't know what it does. 1) HTTP Proxy is basically a webaddress you type in to your companies proxy server so you can access the internet.
You can try:
"System Preferences" -> "Network" -> Select your network device -> "Advanced" -> "Proxies"
You can try using Proxifier: http://www.proxifier.com/mac/ It enables you to set a proxy to any program.
Not what you asked but it should solve your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With