Shouldn't Server.prototype.listen accept a callback like node's?
I'm guessing that the callback in node's .listen() is a recent addition and therefore not yet in connect?
Thanks.
What's the code you're trying? Connect's Server is a subclass of Node's HTTP server, and doesn't even touch the listen function itself (I'm pretty sure, haven't quite checked). I'm using a listen callback in nTunes (in bin/nTunes).
This should work:
var connect = require("connect");
connect.createServer(
connect.staticProvider(__dirname)
).listen(80, function() {
console.log("Port binded!");
})
Connect's Server .listen() only accepts two arguments, but node's accepts three. The third being an optional hostname (otherwise the server listens on any IP). When I was passing a callback as a second argument, like you are, it works as you show, but I also want to prevent access on an internal IP address (hence bind to the external one only).
Ex. var app = connect.createServer(); app.listen(80, 'myapp.com', function() { console.log("... and ready!"); });
See if 14dc8dc11cb7ff0b1fc8892f7c5810a1137f637f fixes your issue.
Thanks!