2017 © Pedro Peláez
 

library getlocalipjs

Little JS to get local IP address

image

cornips/getlocalipjs

Little JS to get local IP address

  • Tuesday, September 19, 2017
  • by cornips
  • Repository
  • 1 Watchers
  • 2 Stars
  • 0 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 469 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

DEPRECATED

This code doesn't work anymore and I'm not planning on updating it., (*1)

Introduction

To identify clients in internal web systems it is sometimes useful to know its local IP address. With this little JS (only 847 bytes gzipped), borrowed from Daniel Roesler, you can do this., (*2)

Installation

npm install getlocalipjs

Usage

Just make sure you have the following code in your HTML at the bottom:, (*3)

<!-- hidden iframe to bypass webrtc blocking -->
<iframe id="iframe" sandbox="allow-same-origin" style="display:none"></iframe>
<script src="dist/getlocalip.min.js"></script>
<script>
    getLocalIP(function(ip){
        console.log(ip);
    });
</script>

The Versions

19/09 2017

dev-master

9999999-dev

Little JS to get local IP address

  Sources   Download

MIT

by Martijn Cornips