• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting client IP address

 
sitaram irrinki
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • 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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!