• 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

getting client IP address

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
while accessing client IP address we should use the fllowing method,

String addr = request.getRemoteAddr();
System.out.println(addr);

If the client uses Proxy server then the sever gets the proxy IP Address, How can server gets exact IP number(Not Proxy).

Ex: The IP address of the system is 172.16.0.113, the proxy IP number is 172.16.0.200. when we the above methos we are getting 172.16.0.200, but we need 172.16.0.113.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Um, but isn't that the purpose of the Proxy, for protection. You wouldn't be able to get to the IP address of the machine directly anyway, you would always have to go through the proxy.

If you were able to get through then you could do some major damage to those personal machines, which wouldn't be good press for Java.

Or I could be wrong.

Mark
 
Ranch Hand
Posts: 472
Objective C Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it's quite impossible, unless you have an applet on client side, which can send you exact IP. For example my IP inside company 10.10.10.xx based, but all web sites report it as 192 something based.
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic