我们在我们的项目中使用okhttp v3.8.0。我们必须在https请求上专门为代理服务器添加自定义标头。问题是,当我设置“.header(”Something“,”FRR“)”时,标头也会在https请求上加密,所以它不会被代理服务器识别。我怎样才能做到这一点?我想在Initial方法中发送未加密的头文件。 这就是我把我的请求,代理服务器现在:Okhttp:在https请求中为代理服务器添加未加密的自定义标头
OK_HTTP_CLIENT = builder
.connectTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.cookieJar(cookieJar)
.retryOnConnectionFailure(true)
.proxy(proxy)
.proxyAuthenticator(proxyAuthenticatorMainAccount)
.build();
Request request = new Request.Builder()
.url(url)
.header("Something", "FRR")
.build();
Response response = OK_HTTP_CLIENT.newCall(request).execute();
There is screenshot here, explain what i want to achieve in more details
@SLaks我只是编辑我的文章,并附上一张截图,解释我想实现更多细节,我想知道你是否可以看看它 –
这可能是不可能的。 – SLaks