[
https://issues.apache.org/jira/browse/CAMEL-22689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18038026#comment-18038026
]
Lukas Lowinger commented on CAMEL-22689:
----------------------------------------
I'm just attaching my findings which could help:
To be able to set *nonProxyHosts* we could try to follow *useSystemProperties*
as per
[https://camel.apache.org/components/4.10.x/http-component.html#_using_system_properties]
But having eg. *camel.component.http.useSystemProperties=true* + setting system
property *-Dhttp.nonProxyHosts=*google.it|*httpbin.org* (as per
[https://hc.apache.org/httpcomponents-client-5.5.x/current/httpclient5/apidocs/org/apache/hc/client5/http/impl/classic/HttpClientBuilder.html]
)is not helping as the line we need to trigger is this
[https://github.com/apache/camel/blob/camel-4.10.0/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java#L290]
and that is triggered only when *useSystemProperties* is set on the endpoint.
So it would have to be eg. *.to("http://httpbin.org?useSystemProperties=true")*
Then using eg.
{code:java}
mvn clean install -DskipTests && java -Dhttp.proxyHost=127.0.0.1
-Dhttp.proxyPort=1234 -Dhttp.nonProxyHosts="*httpbin.org" -jar <camel-jar>{code}
correctly picks the http.proxyHost and http.proxyPort and http.nonProxyHosts.
It would be nice to fix the propagation of *useSystemProperties* on component
level as part of this issue.
> camel-http - Add nonProxyHosts option to exclude hosts/domains from proxy
> -------------------------------------------------------------------------
>
> Key: CAMEL-22689
> URL: https://issues.apache.org/jira/browse/CAMEL-22689
> Project: Camel
> Issue Type: Improvement
> Components: camel-http
> Reporter: Luigi De Masi
> Assignee: Luigi De Masi
> Priority: Major
>
> Currently, the camel-http component supports proxy configuration through
> options like
> \{{proxyAuthHost}}, \{{proxyAuthPort}}, \{{proxyAuthUsername}}, and
> \{{proxyAuthPassword}}.
> However, there is no way to exclude specific hosts or domains from going
> through the
> configured proxy.
> Add a \{{nonProxyHosts}} option to the HTTP component that allows users to
> specify a list
> of hosts/domains that should bypass the proxy and connect directly. This
> option should support patterns similar to Java's standard
> \{{http.nonProxyHosts}}
> system property
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)