This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Tomcat and the fly likes protected tomcat  connectors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Products » Tomcat
Bookmark "protected tomcat  connectors" Watch "protected tomcat  connectors" New topic

protected tomcat connectors

John Dunne

Joined: Jun 28, 2005
Posts: 4
Hello All,

Does anyone know of a way to restrict the use of a connector to certain contexts? The problem I have is this: I'm redirecting all traffic from port 80 to a proxy servlet thats within a https context. As I cant redirect from port 80 to 8443 without problems occuring, I'd be happy with opening port 8080 if I could restrict the 8080 port so that only the proxy servlet can be accessed through it!

Thanks in advance,
John Dunne

Joined: Jun 28, 2005
Posts: 4
I'm using Tomcat 5. Is there anyone knowing anything that might lead to something?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13001
All I can think of would be a Filter that examines ALL incoming requests to ports 80 and 8080 and decides if the request is legal..
John Dunne

Joined: Jun 28, 2005
Posts: 4
After a nice stretch in sunny Greece, its now time to solve some more problems!

Thanks for the response.... I'll try your idea....
Ronny Batty

Joined: Jul 15, 2005
Posts: 1
Has anyone had any success with this, you seem to be trying to achieve a similar result to me, sorry if it appears that I'm reposting the same question, just trying to spark a bit of life back into this Thread ;-)

app1 : Setup in its own service with a normal HTTP connector listening on port 8080 and an HTTPS connector listening on port 8443.
app2 : Setup in its own service with a normal HTTP connector listening on port 8081.

My intended goal is to allow only HTTPS access to app1 externally and normal HTTP access to app1 internally (by redirecting port 80 requests to 8081 on our firewall), this would also allow external access to app2 on port 80.

I had assumed that due to the structure of web.xml (ie. a Connector is defined within a Service) that anything picked up by the 8081 connector would be restricted to the app2 Context only, this does not seem to be the case as I can access both app Contexts using any of the 3 connectors :-(

I agree. Here's the link:
subject: protected tomcat connectors
jQuery in Action, 3rd edition