title: Can I get my IP address in a chrome app without using an external service?
body: <p>I am building a <a href="https://developer.chrome.com/apps/about_apps" rel="nofollow">chrome app</a> and created a <strong>UDP socket</strong> via the <a href="https://developer.chrome.com/apps/app_network#udp" rel="nofollow">chrome socket api</a>.</p>
  
  <p>Is there a way to retrieve your own <strong>IP address</strong> without using an external service? 
  What I mean by "own IP address": Both <em>client</em> and <em>server</em> are on the same network. The <strong>chrome app</strong> needs to answer to a <strong>UDP broadcast</strong> with it's own <em>local IP address</em>.</p>
  
  <p>There is actually a <a href="https://developer.chrome.com/apps/sockets_udp#method-getInfo" rel="nofollow">chrome socket API</a> for exactly that use-case. But unfortunately I only receive the following callback object: <code>Object {paused: false, persistent: false, socketId: 17}</code>, which misses the <code>localAddress</code> attribute. It is an <strong>(optional)</strong> attribute in the <code>SocketInfo</code> object according to the <a href="https://developer.chrome.com/apps/sockets_udp#type-SocketInfo" rel="nofollow">documentation</a>. This is in essence the code I am running:</p>
  
  <pre><code>chrome.sockets.udp.create({}, function(socketInfo){
      chrome.sockets.udp.getInfo(socketInfo.socketId, function (detailedInfo){
          ipAddress = detailedInfo.localAddress;
          console.debug(detailedInfo); // containts no `localAddress`
      });
  });
  </code></pre>
  
  <p>I also do not think that I am missing any <a href="https://developer.chrome.com/apps/manifest/sockets" rel="nofollow">manifest-permissions</a> as there are no special permissions described in the <a href="https://developer.chrome.com/apps/manifest/sockets" rel="nofollow">API documentation</a>. This is what I use: </p>
  
  <pre><code>"sockets": {
    "udp": {
      "send": "*",
      "bind": "*"
    }
  }
  </code></pre>
  
  <p>When I use <strong>Python</strong> I can achieve that goal as follows:</p>
  
  <pre><code>import socket
  ip_address = socket.gethostbyname(socket.gethostname())
  </code></pre>
  
  <p>Any help would be great!</p>