Skip to content

Commit

Permalink
Skip Back to My Mac or VPNs for LAN IP.
Browse files Browse the repository at this point in the history
  • Loading branch information
reid committed Sep 19, 2012
1 parent 473e164 commit 9baab57
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/cli.js
Expand Up @@ -279,7 +279,8 @@ var getLocalIP = (function () {
var cachedIP;

function queryLocalIP() {
var localIP,
var name,
localIP,
addresses,
interfaces = os.networkInterfaces(),
interfaceNames = Object.keys(interfaces);
Expand All @@ -296,7 +297,14 @@ var getLocalIP = (function () {
}

do {
interfaces[interfaceNames.pop()]
name = interfaceNames.pop()

// Skip Back to My Mac or VPNs.
if (name.indexOf("utun") === 0) {
continue;
}

interfaces[name]
.filter(internalOnly)
.forEach(tryAddresses);
} while (interfaceNames.length && !localIP);
Expand Down

0 comments on commit 9baab57

Please sign in to comment.