You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2009/03/21 12:47:39 UTC

DO NOT REPLY [Bug 41263] servletRequest.getRemotePort() returns incorrect value when behind mod_jk

https://issues.apache.org/bugzilla/show_bug.cgi?id=41263





--- Comment #5 from Rainer Jung <ra...@kippdata.de>  2009-03-21 04:47:36 PST ---
Just a workaround, not a solution:

You can use JkEnvVar to forward arbitrary data, which is available in the form
of so called httpd environment variables. The remote port fortunately is
available under the name REMOTE_PORT.

So in mod_jk you can set

JkEnvVar REMOTE_PORT

and in the java webapp you can retrieve the data with

request.getAttribute("REMOTE_PORT")

Obviously this is not spec compliant. You might be able to wrap the request in
a filter and overwrite remotePort() using the above call.

A final solution needs an enhanced AJP13 protocol.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org