aspose file tools*
The moose likes Servlets and the fly likes HttpServletRequest. getRemoteAddr() is different from ipconfig /all Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpServletRequest. getRemoteAddr() is different from ipconfig /all" Watch "HttpServletRequest. getRemoteAddr() is different from ipconfig /all" New topic
Author

HttpServletRequest. getRemoteAddr() is different from ipconfig /all

noodle hamilton
Greenhorn

Joined: Jun 08, 2007
Posts: 6
Hi all:
I have deployed my web app locally on my own box. I however didn't not resolve to localhost, i used my own computer name instead...
but what happen is i did a test. I try to access the local web app, make a few requests...
the result of getRemoteAddr() is different from what ipconfig /all give it to me..even though I am doing everything on the same computer..

could somebody explain to me why that is the case???


Many thanks...
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
What are you getting from getRemoteAddr() ? Is that 127.0.0.1


Rahul Bhattacharjee
LinkedIn - Blog
noodle hamilton
Greenhorn

Joined: Jun 08, 2007
Posts: 6
no, i was getting a different ip, it is not 127.0.0.1

it has the same subnet value as what i get from ipconfig /all
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by noodle hamilton:
no, i was getting a different ip, it is not 127.0.0.1


What do you see when you do ping <machineName> ?
Rajesh Agarwal
Ranch Hand

Joined: Aug 01, 2005
Posts: 79
127.0.0.1 is the IP address used to loopback to own machine. this means if we try to connect to 127.0.0.1 , if gets routed to own machine. In other words 127.0.0.1 is you. A ping on local host also returns 127.0.0.1 while your machine might have an IP address
Sutham Rojanusorn
Greenhorn

Joined: Aug 12, 2005
Posts: 9
are you sure that you have network connected? or any proxy attached?
please check
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpServletRequest. getRemoteAddr() is different from ipconfig /all
 
Similar Threads
No Response After Deployment
DHCP server
Deploying servlet
IP address of my computer
java.net.ConnectException: Connection refused: