1

How to obtain local ip address of PC using Javascript in MAC Safari Browser? Looking for solution which works with Safari Web Browser.

I mean local ip address of device/PC network interface. Not public ip address as of "what is my ip"

Anupam
  • 869
  • 7
  • 13
  • I would start looking at this: http://stackoverflow.com/questions/391979/get-client-ip-using-just-javascript – Alan Nov 23 '15 at 08:55
  • 1
    @Alan I mentioned clearly. I am not looking for public ip address. I am looking for PC local ip address. – Anupam Nov 23 '15 at 09:28
  • Ok, I would first learn the linux command to do that: http://stackoverflow.com/questions/13322485/how-to-i-get-the-primary-ip-address-of-the-local-machine-on-linux-and-os-x and then pass it through javascript: http://stackoverflow.com/questions/12941083/get-the-output-of-a-shell-command-in-node-js . Hopefully this will point you to the right direction. – Alan Nov 23 '15 at 09:34

1 Answers1

1
  1. Mostly - you can't.
  2. But - here come WebRTC's RTCPeerConnection command and enables you to do that.
  3. References:

    Accessing local IP with WebRTC: Link

    Live working example: Link

    Example of detecting all IP addresses in your local range: Link

Hope that helps MAC addresses in JavaScript: Link

Community
  • 1
  • 1
Lavi Avigdor
  • 4,092
  • 3
  • 25
  • 28