diff --git a/lib/server.js b/lib/server.js index 2853582..b866ff8 100644 --- a/lib/server.js +++ b/lib/server.js @@ -651,8 +651,8 @@ Server.prototype.after = function () { // All these just reexpose the requisite net.Server APIs Server.prototype.listen = function (port, host, callback) { - if (typeof port !== 'number') - throw new TypeError('port (number) required'); + if (typeof (port) !== 'number' && typeof (port) !== 'string') + throw new TypeError('port (number or path) required'); if (typeof (host) === 'function') { callback = host;