You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alessandro Vernet <av...@scdi.org> on 2007/01/31 20:15:22 UTC

request.getServerPort() returns wrong port when using tcpmon

When the request I send to Tomcat go through tcpmon, calls to
httpServletRequest.getServerPort() in my code always return 80. This is
incorrect, as Tomcat is listening in fact to port 8080. I don't have this
problem when request don't do through tcpmon.

I am having this issue with Tomcat 5.5.16, and haven't tried yet with other
versions.

Any suggestion?

Alex
-- 
View this message in context: http://www.nabble.com/request.getServerPort%28%29-returns-wrong-port-when-using-tcpmon-tf3150713.html#a8735838
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: request.getServerPort() returns wrong port when using tcpmon

Posted by Alessandro Vernet <av...@scdi.org>.

Alessandro Vernet wrote:
> 
> When the request I send to Tomcat go through tcpmon, calls to
> httpServletRequest.getServerPort() in my code always return 80. This is
> incorrect, as Tomcat is listening in fact to port 8080. I don't have this
> problem when request don't do through tcpmon.
> 

I found the reason for this behavior. It is quite simple actually: I am
using Axis tcpmon packaged as a plug-in for IntelliJ
(http://www.intellij.org/twiki/bin/view/Main/TcpMonitor), and that version
of tcpmon always sends Host: localhost, instead of Host: localhost:8080 when
it forwards the request to port 8080.

Other versions of tcpmon (like this one: https://tcpmon.dev.java.net/) send
a Host header with a correct port. So it just looks like a bug in that
IntelliJ's plug-in.

Alex
-- 
Orbeon Forms - Web Forms for the Enterprise, Done the Right Way
http://www.orbeon.com/

-- 
View this message in context: http://www.nabble.com/request.getServerPort%28%29-returns-wrong-port-when-using-tcpmon-tf3150713.html#a8759563
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org