@@ -54,8 +54,8 @@ private static void createHttpClient() {
54
54
context .setCookieStore (cookieStore );
55
55
56
56
RequestConfig .Builder globalConfigBuilder = RequestConfig .custom ().setCookieSpec (CookieSpecs .STANDARD )
57
- .setConnectTimeout (5000 ).setConnectionRequestTimeout (1000 )
58
- .setSocketTimeout (5000 )
57
+ .setConnectTimeout (30000 ).setConnectionRequestTimeout (10000 )
58
+ .setSocketTimeout (30000 )
59
59
.setCookieSpec (CookieSpecs .STANDARD_STRICT )
60
60
.setExpectContinueEnabled (Boolean .TRUE ).setTargetPreferredAuthSchemes (Arrays .asList (AuthSchemes .NTLM , AuthSchemes .DIGEST ))
61
61
.setProxyPreferredAuthSchemes (Arrays .asList (AuthSchemes .BASIC ));
@@ -67,7 +67,7 @@ private static void createHttpClient() {
67
67
if (config != null && config .getProxy () && proxySettings != null && proxySettings .USE_HTTP_PROXY && !proxySettings .PROXY_TYPE_IS_SOCKS ) {
68
68
HttpHost proxy = new HttpHost (proxySettings .PROXY_HOST , proxySettings .PROXY_PORT , "http" );
69
69
globalConfigBuilder .setProxy (proxy );
70
- if (proxySettings .PROXY_AUTHENTICATION ){
70
+ if (proxySettings .PROXY_AUTHENTICATION ) {
71
71
provider = new BasicCredentialsProvider ();
72
72
provider .setCredentials (new AuthScope (proxy ), new UsernamePasswordCredentials (proxySettings .getProxyLogin (), proxySettings .getPlainProxyPassword ()));
73
73
}
@@ -201,14 +201,13 @@ public void checkServerTrusted(X509Certificate[] xcs, String str) {
201
201
.register ("http" , PlainConnectionSocketFactory .INSTANCE )
202
202
.register ("https" , socketFactory ).build ();
203
203
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager (socketFactoryRegistry );
204
-
204
+ connectionManager .setDefaultMaxPerRoute (200 );
205
+ connectionManager .setMaxTotal (400 );
205
206
return connectionManager ;
206
207
207
208
} catch (Exception e ) {
208
209
LogUtils .LOG .error ("创建PoolingHttpClientConnectionManager失败" , e );
209
210
}
210
211
return new PoolingHttpClientConnectionManager ();
211
212
}
212
-
213
-
214
213
}
0 commit comments