package com.conveyal.taui.util;

import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

/**
 * Created by matthewc on 2/15/17.
 */
public class HttpUtil {
    public static final CloseableHttpClient httpClient = HttpClients.createDefault();
}

@@ -60,32 +60,84 @@
 ent.HttpClient;%0A
+import org.apache.http.client.config.RequestConfig;%0A
 import org.apach
@@ -168,32 +168,32 @@
 ableHttpClient;%0A
-
 import org.apach
@@ -301,87 +301,484 @@
    p
-ublic static final CloseableHttpClient httpClient = HttpClients.createDefault
+rivate static final RequestConfig requestConfig = RequestConfig.custom()%0A            .setConnectTimeout(60 * 1000)%0A            .setSocketTimeout(60 * 1000)%0A            .build(); // time out after one minute, prevent connections from becoming blocked.%0A%0A    public static final CloseableHttpClient httpClient = HttpClients.custom()%0A            .setMaxConnPerRoute(1024)%0A            .setMaxConnTotal(2048)%0A            .setDefaultRequestConfig(requestConfig)%0A            .build
 ();%0A
+%0A
 %7D%0A

add timeouts to HTTP client library.