0

Is it possible to get a visitor/requester public (WAN/external) IP address with pure Javascript? IE. without the use of additional JS libraries like jQuery? If so, how?

Stephen Ostermiller
  • 99,822
  • 18
  • 143
  • 364
Salem874
  • 111
  • 2

1 Answers1

0

Javascript runs on the client, which may have multiple network conenctions, which may be behind firewalls and NATs. You will only be able to retrieve the IP address once the connection has been made outside of the network.

You could call a service that just bounces back the IP address, but this requires having the service and bandwidth set up.

cjk
  • 313
  • 2
  • 12