• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ports Problem  RSS feed

 
Jas Oberai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I am having some port issues in my application.The router has been set such that any request to port 80 goes to the web server and for some ports it comes to the server on which my application is hosted.And,I need to extract the port number on which the request was made and generate the response accordingly.I am using getServerPort() right now in my application.So,if the user sends a request say for instance,
www.tomyserver.com:1234
I need to extract the 1234 part in my servlet and generate the response.When I test that from some places it works and from some places it doesn't works properly.Actually,I read the getServerPort() and getlocalPort() definitions:

Can someone please elaborate me...when to use which one??Your help would be really appreciated.
Thanks
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need to know the port numbers? - there might be another way around your problem.

If you are using a NAT router, you might have problems with using NAT - can you configure the webserver to proxy requests to your server by virtual host?

You might try posting this in "Sockets and Internet Protocols"
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!