title: How to get client IP address in JavaScript?
body: <p>I'm trying to get the client's IP address. This is my code so far.
  Any suggestions?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script type="application/javascript"&gt;
    function getIP(json) {
      document.write("My public IP address is: ", json.ip);
    }
  &lt;/script&gt;
  &lt;script type="application/javascript" src="http://ipinfo.io/?format=jsonp&amp;callback=getIP"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>