code: private void setupProxyIfNeeded(HttpClientBuilder builder) {
          if (httpProxy != null) {
              builder.setProxy(new HttpHost(httpProxy.getHost(),httpProxy.getPort()));
              if (httpProxy.getUser() != null) {
                  AuthScope proxyAuthScope = new AuthScope(httpProxy.getHost(),httpProxy.getPort());
                  UsernamePasswordCredentials proxyCredentials = new UsernamePasswordCredentials(httpProxy.getUser(),httpProxy.getPass());
                  CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
                  credentialsProvider.setCredentials(proxyAuthScope,proxyCredentials);
                  builder.setDefaultCredentialsProvider(credentialsProvider);
              }
          }
      }
docs: ==========================================================================================