code: protected HttpClient getHttpClient(){
  
          HttpClientBuilder builder = HttpClientBuilder.create();
  
          if(proxyHost != null && proxyPort != 0) {
              HttpHost proxy = new HttpHost(proxyHost, proxyPort);
              DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
              builder.setRoutePlanner(routePlanner);
          }
  
          RequestConfig.Builder config = RequestConfig.custom()
                  .setConnectTimeout(timeout)
                  .setConnectionRequestTimeout(timeout)
                  .setSocketTimeout(timeout);
  
          builder.setDefaultRequestConfig(config.build());
  
          return builder.build();
      }
docs: Get a HTTP client. With proxy if a proxy is provided in the constructor.
  @return a HTTP client