portfinder.basePort = 8080; //set basePort = 8080
portfinder.getPort(function(err , port){
console.log(port);
//return 8080
})
in eachSeries() iteration callback: host is 0.0.0.0
in eachSeries() iteration callback: host is 0.0.0.0
entered testPort(): trying 0.0.0.0 port 8080
done w/ testPort(): OK 0.0.0.0 port 8080
in eachSeries() iteration callback testPort() callback with a success for port 8080
in eachSeries() iteration callback: host is fe80::15d0:1e6b:e232:f2b3
in eachSeries() iteration callback: host is fe80::15d0:1e6b:e232:f2b3
entered testPort(): trying fe80::15d0:1e6b:e232:f2b3 port 8080
done w/ testPort(): OK fe80::15d0:1e6b:e232:f2b3 port 8080
in eachSeries() iteration callback testPort() callback with a success for port 8080
in eachSeries() iteration callback: host is 10.1.113.89
in eachSeries() iteration callback: host is 10.1.113.89
entered testPort(): trying 10.1.113.89 port 8080
done w/ testPort(): OK 10.1.113.89 port 8080
in eachSeries() iteration callback testPort() callback with a success for port 8080
in eachSeries() iteration callback: host is ::1
in eachSeries() iteration callback: host is ::1
entered testPort(): trying ::1 port 8080
done w/ testPort(): OK ::1 port 8080
in eachSeries() iteration callback testPort() callback with a success for port 8080
in eachSeries() iteration callback: host is 127.0.0.1
in eachSeries() iteration callback: host is 127.0.0.1
entered testPort(): trying 127.0.0.1 port 8080
done w/ testPort(): OK 127.0.0.1 port 8080
in eachSeries() iteration callback testPort() callback with a success for port 8080
in eachSeries() result callback: openPorts is [ 8080, 8080, 8080, 8080, 8080 ]
>node
> os.networkInterfaces()
{ '以太网':
[ { address: 'fe80::15d0:1e6b:e232:f2b3',
netmask: 'ffff:ffff:ffff:ffff::',
family: 'IPv6',
mac: '08:9e:01:d0:95:14',
scopeid: 17,
internal: false },
{ address: '10.1.113.89',
netmask: '255.255.255.0',
family: 'IPv4',
mac: '08:9e:01:d0:95:14',
internal: false } ],
'Loopback Pseudo-Interface 1':
[ { address: '::1',
netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
family: 'IPv6',
mac: '00:00:00:00:00:00',
scopeid: 0,
internal: true },
{ address: '127.0.0.1',
netmask: '255.0.0.0',
family: 'IPv4',
mac: '00:00:00:00:00:00',
internal: true } ] }
PS D:\> netstat -ano | findstr "8080"
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 54108
TCP [::]:8080 [::]:0 LISTENING 54108
TCP [::1]:8080 [::1]:51001 ESTABLISHED 54108
TCP [::1]:8080 [::1]:51544 ESTABLISHED 54108
TCP [::1]:51001 [::1]:8080 ESTABLISHED 11256
TCP [::1]:51544 [::1]:8080 ESTABLISHED 11256
//line 444 , insert "::" to the array
results = [hiddenButImportantHost , '::'];
hiddenButImportantHost = '0.0.0.0', // !important - dont remove, hence the naming :)