#370 WxMpServiceOkHttpImpl改用httpProxy

This commit is contained in:
Binary Wang
2017-11-09 17:02:48 +08:00
parent a2cf1f66e5
commit 802f9e8a28
3 changed files with 17 additions and 8 deletions

View File

@@ -67,8 +67,15 @@ public class WxCpServiceOkHttpImpl extends WxCpServiceAbstractImpl<OkHttpClient,
@Override
public void initHttp() {
this.log.debug("WxCpServiceOkHttpImpl initHttp");
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
//设置代理
if (configStorage.getHttpProxyHost() != null && configStorage.getHttpProxyPort() > 0) {
httpProxy = OkHttpProxyInfo.httpProxy(configStorage.getHttpProxyHost(),
configStorage.getHttpProxyPort(),
configStorage.getHttpProxyUsername(),
configStorage.getHttpProxyPassword());
}
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
if (httpProxy != null) {
clientBuilder.proxy(getRequestHttpProxy().getProxy());