java - Using request.getRemoteAddr() returns 0:0:0:0:0:0:0:1 -
i trying print ip adress of logged user in webapplication. if user connects pc (which under same network, web application running in pc) using ip address 192.168.10.120:8080/webapplication
code request.getremoteaddr()
or request.getlocaladdr())
returns ip address. when log in pc run web application, ip address 0:0:0:0:0:0:0:1.
why that? , what's difference between these commands (which should use?).thank lot!
in case, trying access on local machine,so return value. let 1 of friend access it, , receive expected result getremoteaddr
from javadoc:
getremoteaddr - returns ip address of client or last proxy sent request
getlocaladdr - returns ip address of interface on request received.
Comments
Post a Comment