Skip to content

Commit

Permalink
net.binding.bind() requires 3 params or you get errors on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
baudehlo committed Mar 14, 2011
1 parent 2c7f51e commit 4e5e2be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -15,6 +15,7 @@ server. The options argument may have the following properties:

* port - specifying the port number to listen on (defaults to 80)
* nodes - specifying the number of node processes (defaults to 1)
* host - address to listen on (defaults to 0.0.0.0)
* masterListen - Indicate whether the master process should listen and handle
requests as well (on by default, but you may want to turn this off if you processes are
prone to dying and you want to reliably utilize auto-restart of processes), defaults to true
Expand Down Expand Up @@ -90,4 +91,4 @@ Licensing
Multi-node is part of the Persevere project, and therefore is licensed under the
AFL or BSD license. The Persevere project is administered under the Dojo foundation,
and all contributions require a Dojo CLA.


2 changes: 1 addition & 1 deletion lib/multi-node.js
Expand Up @@ -35,7 +35,7 @@ exports.listen = function(options, server){
emitter.id = "master";
var children = [],
tcpDescriptor = netBinding.socket("tcp4");
netBinding.bind(tcpDescriptor, options.port || 80);
netBinding.bind(tcpDescriptor, options.port || 80, options.host || '0.0.0.0');
netBinding.listen(tcpDescriptor, 128);
var masterListen = options.masterListen !== false;
var numChildren = (options.nodes || 1) - (masterListen ? 1 : 0);
Expand Down

0 comments on commit 4e5e2be

Please sign in to comment.