Skip to content

shaharmor/webrtc-private-ip

Repository files navigation

webrtc-private-ip

Get your private-ip using WebRTC

Install

$ npm install webrtc-private-ip

Or using a CDN:

<script src="https://unpkg.com/@shaharmor/webrtc-private-ip"></script>

Usage

(async () => {
  const ip = await webrtcPrivateIp();
  if (ip) {
    //ip => '192.168.1.1'
  }
})()

Limitations

  • Will only works when WebRTC mDNS is not enabled.