Rudig Rudig - 1 year ago 486
Java Question

Using retrofit behind a proxy

I am trying to call a Restful service with Retrofit from behind a proxy.
Is there anyway to to set proxy settings on Retrofit in the code?

Answer Source

Retrofit does not have options for setting any network related settings. You need to set proxy to your Retrofit http client.

Set Proxy, to your OkHttpClient using setProxy(proxy) method

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download