代理设置

This commit is contained in:
egan
2018-06-28 20:06:20 +08:00
parent c5b3c551b8
commit c0af178665
2 changed files with 8 additions and 7 deletions

View File

@@ -134,11 +134,6 @@ public class HttpRequestTemplate {
*/
public CredentialsProvider createCredentialsProvider(HttpConfigStorage configStorage){
if (StringUtils.isNotBlank(configStorage.getHttpProxyHost())) {
//http代理地址设置
httpProxy = new HttpHost(configStorage.getHttpProxyHost(),configStorage.httpProxyPort);;
}
if (StringUtils.isBlank(configStorage.getAuthUsername())) {
return null;
@@ -185,6 +180,12 @@ public class HttpRequestTemplate {
*/
public HttpRequestTemplate setHttpConfigStorage(HttpConfigStorage configStorage) {
this.configStorage = configStorage;
if (StringUtils.isNotBlank(configStorage.getHttpProxyHost())) {
//http代理地址设置
httpProxy = new HttpHost(configStorage.getHttpProxyHost(),configStorage.httpProxyPort);;
}
return this;
}