-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Description
Really like this new new listen function, but I've found it's pickier than the others about port being a js number vs a string number, and the error is unclear (uses poor stringification of the object):
// Old .listen(port[, host][, callback])
http.createServer(function (req, res) {
res.end("\n")
}).listen("8005")
Works fine, converting "8005"
to 8005
.
While:
// New .listen(options[, callback])
http.createServer(function (req, res) {
res.end("\n")
}).listen({port: "8005"})
Throws:
Error: Invalid listen argument: [object Object]
at Server.listen (net.js:1278:15)
at repl:1:56
at REPLServer.defaultEval (repl.js:116:27)
at bound (domain.js:254:14)
at REPLServer.runBound [as eval] (domain.js:267:12)
at REPLServer.<anonymous> (repl.js:269:12)
at emitOne (events.js:77:13)
at REPLServer.emit (events.js:166:7)
at REPLServer.Interface._onLine (readline.js:195:10)
at REPLServer.Interface._line (readline.js:534:8)
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.