You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "zirong (Jira)" <ji...@apache.org> on 2022/06/26 10:20:00 UTC
[jira] [Created] (HTTPCLIENT-2225) The proxy in defaultRequestConfig of HttpAsyncClients not work
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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org