resovle conflict

pull/223/merge
yihua.huang 9 years ago
parent 9de64ea0f2
commit 2400ff7e1a

@ -63,6 +63,14 @@ public class HttpClientGenerator {
httpClientBuilder.setDefaultCredentialsProvider(credsProvider);
}
if(site!=null&&site.getHttpProxy()!=null&&site.getUsernamePasswordCredentials()!=null){
credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(
new AuthScope(site.getHttpProxy()),//可以访问的范围
site.getUsernamePasswordCredentials());//用户名和密码
httpClientBuilder.setDefaultCredentialsProvider(credsProvider);
}
httpClientBuilder.setConnectionManager(connectionManager);
if (site != null && site.getUserAgent() != null) {
httpClientBuilder.setUserAgent(site.getUserAgent());
@ -82,13 +90,6 @@ public class HttpClientGenerator {
});
}
if(site!=null&&site.getHttpProxy()!=null&&site.getUsernamePasswordCredentials()!=null){
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(
new AuthScope(site.getHttpProxy()),//可以访问的范围
site.getUsernamePasswordCredentials());//用户名和密码
httpClientBuilder.setDefaultCredentialsProvider(credsProvider);
}
SocketConfig socketConfig = SocketConfig.custom().setSoKeepAlive(true).setTcpNoDelay(true).build();
httpClientBuilder.setDefaultSocketConfig(socketConfig);

Loading…
Cancel
Save