I am trying to get the user Host, IP, and Port using:
request.getRemoteHost()
request.getRemoteAddr()
request.getRemotePort()
But I am getting:
Host: 0:0:0:0:0:0:0:1
IP: Address null
Port: 51111
How do I get the correct IP address, noting that our network IP start with 10.100.x.x
Many thanks.
If you are using the
localhostin your request URI, then the IPv6 is0:0:0:0:0:0:0:1. Instead of usinglocalhost, use your IPv4 in your request URI to get the correct IP.