Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-2225

The proxy in defaultRequestConfig of HttpAsyncClients not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.1.3
    • 5.1.4, 5.2
    • HttpClient (async)
    • None

    Description

      The proxy host within DefaultRequestConfig will be ignored when creating httpAsyncClient and sending request using the following code.

      CloseableHttpAsyncClient client = HttpAsyncClients.custom()
              .setConnectionManager(cm)
              .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
              .setDefaultRequestConfig(RequestConfig.custom().setProxy(proxy).build())
               .build();
      
      final SimpleHttpRequest request = SimpleRequestBuilder.get()
              .setHttpHost(target)
              .setPath("/")
              .build();
      
      final Future<SimpleHttpResponse> future = client.execute(
              SimpleRequestProducer.create(request),
              SimpleResponseConsumer.create(),
              HttpClientContext.create(),
              new FutureCallback<SimpleHttpResponse>() {...});

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            zirong zirong
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: