Search code examples
iosproxynsurlsessionnsurlsessionconfiguration

Overriding Proxy in Device Settings for NSURLSessionConfiguration?


Is it possible to ignore the proxy settings that are in the device network settings, and instead use no proxy when using an NSURLSession ?

Basically I want to fall back on using no proxy if the connection fails.

Thanks !


Solution

  • I'm pretty sure that providing an empty connectionProxyDictionary in a session configuration should do the trick. Note that it must be an actual empty dictionary. Setting it to nil uses the default system proxy settings.