Difference between request.getRemoteAddr() and request.getLocalAddr()?
Joined: Mar 08, 2012
I need to get the client IP so i was using getRemoteAddr() then one of my friend told me i need to use getLocalAddr() instead of this(the first one was working fine).
When i read the description i'm bit confused about getLocalAddr(), from the description i understand it'll returns IP of the interface on which the request was received.
It won't be client IP, right? Is it the server IP?
Please help me
Joined: Apr 07, 2009
getRemoteAddr() is what you need to use:
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
getLocalAddr() returns the IP of the server the application is running on.