How can I use getLocalPort to get backend port instead of the front httpd port?

Solution Unverified - Updated -

Issue

  • Having a test on EAP to make sure which port does the http request come from, http connector on 8080, or ajp on 8009. And I take mod_jk/mod_cluster on apache httpd as frontend. The httpd listen on 80.
  • In my servlet I try to use getServerPort() or getRemotePort(), but all the result is 80. The getLocalPort() is 0 or -1. Is there someway to get the correct port number?

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 4.3
    • 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content