Remco Schoen created CAMEL-10270:
------------------------------------
Summary: Jetty 9 X-Forwarded-For Configuration
Key: CAMEL-10270
URL: https://issues.apache.org/jira/browse/CAMEL-10270
Project: Camel
Issue Type: Bug
Components: camel-jetty
Affects Versions: 2.17.3
Reporter: Remco Schoen
Priority: Minor
My integration is behind a proxy and I would like access to the real ip of the
client.
In the Jetty component documentation there is information how to do this in
Jetty 8. This document still refers to the old JettyHttpComponent and not the
new JettyHttpComponent8.
http://camel.apache.org/jetty.html - Obtaining X-Forwarded-For header with
HttpServletRequest.getRemoteAddr()
In Jetty 9 it is done differently and they now use so called customizers:
http://www.eclipse.org/jetty/documentation/9.4.x/configuring-connectors.html#_proxy_load_balancer_connection_configuration
I got it to work by manually adding this line in
JettyHttpComponent9.createConnectorJettyInternal:
httpConfig.addCustomizer(new
org.eclipse.jetty.server.ForwardedRequestCustomizer());
I tried adding an extra parameter for this in the components, not sure if it is
the right way.
My solution in the sping dsl:
<bean id="jetty"
class="org.apache.camel.component.jetty9.JettyHttpComponent9">
<property name="useXForwardedForHeader" value="true"/>
</bean>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)