KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to print the IP address of the logged-in user in my web application. If a user connects from another PC (within the same network, as the web application is running in my pc) using the IP address 192.168.10.120:8080/WebApplication the code request.getRemoteAddr() or request.getLocalAddr()) returns their IP address. However, when I log in from my pc, which runs the web application, I get this IP address 0:0:0:0:0:0:0:1 . Why is this happening? And what's the difference between these commands (which one should I use)? Thank you in advance!
Tags (comma-separated)
Save Edits
Cancel