Reputation: 805
we recently use AFNetworking instead of ASIHttpRequest. But I cannot find any API in AFNetworking to set proxy details for a request as ASIHttpRequest offered. Could anyone give a help? Thanks!
Upvotes: 3
Views: 3610
Reputation: 66292
AFNetworking uses NSURLRequest objects for the actual networking.
NSURLRequest does not support configurable HTTP proxies, except that it will of course follow the proxy server set up in your network preferences.
Possible solutions; none ideal:
You can also submit an enhancement request to Apple.
If you choose option #2, you might be able to wrap it in an NSOperation subclass and throw it into AFNetworking's operation queue. I'm not sure if that would work though. Either way, you might also be able to get some helpful code from the ASIHTTPRequest code base.
Update for AFNetworking / iOS 7: If you use the *session instead of the *requestoperation interface, you can configure an HTTP Proxy using [NSURLSessionConfiguration -connectionProxyDictionary]
.
Upvotes: 3