我們在我們的項目中使用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