Web Connection
Request.getIpAddress
Gravatar is a globally recognized avatar based on your email address. Request.getIpAddress
  Scott R
  All
  Dec 16, 2019 @ 09:56am

Rick,

Just a quick question. On the Request object there is the getIpAddress(). Does this return the public IP from where the request was made or the internal IP from a LAN from the device?

The reason I ask is, I was assuming it was the public IP but as I'm testing in my office with a phone on our network, I'm getting the internal IP for the phone on our wifi. Not sure if this is because I have internal routing rules where my request is hitting our firewall and redirecting to my dev box and never hitting the WAN or does it always return internal IP?

Thanks,

Scott

Gravatar is a globally recognized avatar based on your email address. re: Request.getIpAddress
  Rick Strahl
  Scott R
  Dec 16, 2019 @ 11:11am

The IP Address is whatever the socket that's connected to the Web server sees. What that is depends on your routing setup on your network.

+++ Rick ---

© 1996-2024