/find-server

find the closest server to a port

Primary LanguageJavaScript

find-server

usage:

$ find-server localhost 8080
8088
$ find-server localhost 8080 8085
Could not find server
$ echo $?
1
$ find-server localhost 5000
Could not find server
$ echo $?
1
var findServer = require('find-server');

findServer('localhost', 8000, 9000, function(err, port) {
  console.log(port);
});