title: Get local IP via Javascript and Java in asp.net
body: <p>I need to find User's local IP. The server is behind a router, so I cannot use any server-side method. I also don't want to use any 3rd party service like <code>http://jsonip.appspot.com/</code> because I tested it and its server goes down from time to time.</p>
  
  <p>Using Java, I I want to get the IP through something like</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          function myIP() {
              var yip2 = java.net.InetAddress.getLocalHost();
              var yip = yip2.getHostAddress();
              return yip;
          } //end myIP
  
          alert("your machine's local network IP is " + myIP())
      &lt;/script&gt;
  </code></pre>
  
  <p>but It's not working. How can I get it work?</p>