在代理后面使用改造
我正在尝试从代理后面调用带有改造的Restful服务。在代码中对改造设置代理设置有没有办法?
将尼古拉的话转化为代码:
java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
OkHttpClient client = new OkHttpClient.Builder().proxy(proxy).build();
Retrofit.Builder builder = new Retrofit.Builder().client(client);
Retrofit retrofit = builder.build();