camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remco Schoen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-10270) Jetty 9 X-Forwarded-For Configuration
Date Thu, 25 Aug 2016 11:03:21 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-10270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Remco Schoen updated CAMEL-10270:
---------------------------------
    Attachment: JettyHttpComponent.java

> 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
>         Attachments: JettyHttpComponent.java, JettyHttpComponent9.java
>
>
> 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)

Mime
View raw message