This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var net = require('net'); | |
var portfinder = require('portfinder'); | |
// console.log(process.env); | |
portfinder.getPort({ port: 58886 }, function (err, port) { | |
if (err) { | |
throw err; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG=portfinder* ember s -p 0 | |
portfinder:defaultHosts exports._defaultHosts is: [ '127.0.0.1', '::1', 'fe80::1', 'fe80::8c3:5090:6f70:ebcd', '10.0.1.22', 'fe80::fc77:49ff:fe37:c7e5', '10.211.55.2', '10.37.129.2', 'fe80::4c67:fb4:a09c:efff' ] +0ms | |
portfinder:getPort in eachSeries() iteration callback: host is 127.0.0.1 +513ms | |
portfinder:testPort entered testPort(): trying 127.0.0.1 port 49153 +2ms | |
portfinder:testPort done w/ testPort(): OK 127.0.0.1 port 49153 +5ms | |
portfinder:tryConnection Try Connection client -> server -> client: OK PORTFINDER +10ms | |
portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 49153 +4ms | |
portfinder:getPort in eachSeries() iteration callback: host is ::1 +0ms | |
portfinder:testPort entered testPort(): trying ::1 port 49153 +0ms | |
portfinder:testPort done w/ testPort(): OK ::1 port 49153 +1ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG=* npm test | |
> portfinder@1.0.13 test /Users/trom/Documents/desktop_space/Dropbox/dev/dev-oss/node-portfinder | |
> vows test/*-test.js --spec | |
portfinder:defaultHosts exports._defaultHosts is: [ '127.0.0.1', '::1', 'fe80::1', 'fe80::8c3:5090:6f70:ebcd', '10.0.1.22', 'fe80::fc77:49ff:fe37:c7e5', '10.211.55.2', '10.37.129.2', 'fe80::4c67:fb4:a09c:efff' ] +0ms | |
♢ portfinder | |
When using portfinder module with 5 existing servers the getPort() method |
Context:
VM: 3 gigs of ram, Parallels Desktop Windows: Bash shell:
- From
cmd.exe
I runbash
which logs me in as root. Then I runsu - user
to use theuser
user, which was installed by default and has a /home/user directory. I could have made a new user with a home directory, add them to the sudo group, but I just used the quickest route possible to test this out.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm test | |
> portfinder@1.0.6 test /Users/trom/Documents/desktop_space/Dropbox/dev/dev-oss/node-portfinder | |
> vows test/*-test.js --spec | |
(node:23360) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. | |
default hosts are %o [ '::1', | |
'127.0.0.1', | |
'fe80::1', | |
'fe80::a299:9bff:fe17:766d', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lo0: | |
[ { 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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
♢ portfinder | |
in eachSeries() iteration callback: host is ::1 | |
entered testPort(): trying ::1 port 32768 | |
done w/ testPort(): OK ::1 port 32768 | |
in eachSeries() iteration callback testPort() callback with a success for port 32768 | |
in eachSeries() iteration callback: host is 127.0.0.1 | |
entered testPort(): trying 127.0.0.1 port 32768 | |
done w/ testPort(): OK 127.0.0.1 port 32768 | |
in eachSeries() iteration callback testPort() callback with a success for port 32768 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm test | |
> portfinder@1.0.2 test /Users/trom/Documents/desktop_space/Dropbox/dev/dev-oss/node-portfinder | |
> vows test/*-test.js --spec | |
♢ portfinder | |
in everyLimit() iteration callback: host is ::1 | |
entered testPort(): trying ::1 port 32768 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* portfinder-test.js: Tests for the `portfinder` module. | |
* | |
* (C) 2011, Charlie Robbins | |
* | |
*/ | |
var vows = require('vows'), | |
assert = require('assert'), | |
portfinder = require('../lib/portfinder'), |
NewerOlder