port-fallback Start a server on an available port. Tries a random higher port if the requested port is taken. Getting Started var portFallback = require('port-fallback'), http = require('http'), defaultPort = 4000, server = http.createServer() portFallback.listen(server, {defaultPort: defaultPort}, function(err, port) { console.log("Listening on "+port) // ... })