zirong  created HTTPCLIENT-2225:
-----------------------------------

             Summary: The proxy in defaultRequestConfig of HttpAsyncClients not 
work
                 Key: HTTPCLIENT-2225
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2225
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient (async)
    Affects Versions: 5.1.3
            Reporter: zirong 


The proxy host within DefaultRequestConfig will be ignored when creating 
httpAsyncClient using the following code.
{code:java}
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>() {...});{code}
 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to