Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

listen to a web server port  RSS feed

 
santosh akella
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i am running a web server lets say tomcat at 8080 ... i want to listen to that port and find out the clients details like ip,port,protocol but when i try to listen to that port its giving me bind exception ...
can pls help me out... thank u
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only one listener can bind to a port at any time. In your case that listener is Tomcat. You can either write a proxy server to intercept requests (i.e. listen to port 8000, have people connect there, get their information and forward requests to port 8080) or work within Tomcat's framework. It's a pretty full-featured web server. I'd be surprised if you couldn't log that information for every request.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!