• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpServletRequest. getRemoteAddr() is different from ipconfig /all

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you getting from getRemoteAddr() ? Is that 127.0.0.1
 
noodle hamilton
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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> ?
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you sure that you have network connected? or any proxy attached?
please check
 
reply
    Bookmark Topic Watch Topic
  • New Topic