We are going to switch our HTTP stack from Apache HttpClient to OkHttp. One piece of code that we have is a broadcast receiver that detects changes in the network proxy and manually updates the HttpClient to route HTTP requests through this proxy.
I'm not sure if I still need to handle this manually with OkHttp?
Quote from the docs setProxySelector:
If this parameter is not set, the system proxy server selector will be used by default.
Looking at [0], it looks like we're covered, since OkHttp uses the system selector by default, which, in turn, allows you to return the properties of the proxy system back to OkHttp routes?
[0] http://docs.oracle.com/javase/7/docs/technotes/guides/net/proxies.html
source
share