Author: rjung Date: Sat Mar 21 14:06:04 2009 New Revision: 756942 URL: http://svn.apache.org/viewvc?rev=756942&view=rev Log: Add warning about remote port to proxy docs page.
Modified: tomcat/connectors/trunk/jk/xdocs/generic_howto/proxy.xml Modified: tomcat/connectors/trunk/jk/xdocs/generic_howto/proxy.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/generic_howto/proxy.xml?rev=756942&r1=756941&r2=756942&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/xdocs/generic_howto/proxy.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/generic_howto/proxy.xml Sat Mar 21 14:06:04 2009 @@ -60,7 +60,7 @@ metadata whenever the application asks for it using Servlet API methods. </p> <p>The following list contains the communication metadata handled by AJP -and the HttpServletRequest API calls which can be used to retrieve them: +and the ServletRequest/HttpServletRequest API calls which can be used to retrieve them: <ul> <li>local name: <code>getLocalName()</code> and <code>getLocalAddr</code>. This is also equal to <code>getServerName()</code>, unless a <code>Host</code> header @@ -105,6 +105,15 @@ </li> </ul> </p> +<warn> +The remote port number has been forgotten in the AJP13 protocol. So <code>getRemotePort()</code> +will incorrectly return 0 or -1. As a workaround you can forward the remote port by setting +<code>JkEnvVar REMOTE_PORT</code> and then either using +<code>request.getAttribute("REMOTE_PORT")</code> instead of <code>getRemotePort()</code> +or wrapping the request in a filter and overriding <code>getRemotePort()</code> with +<code>request.getAttribute("REMOTE_PORT")</code>. Recent versions of Tomcat might +automatically respect the forwarded attribute <code>REMOTE_PORT</code>. +</warn> </section> <section name="Fine Tuning"> <br/> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org