Skip to content
Browse files

net.binding.bind() requires 3 params or you get errors on Mac

  • Loading branch information...
1 parent 2c7f51e commit 4e5e2bef3a3986bd32297915b6a61bea8ad434fc @baudehlo baudehlo committed Mar 14, 2011
Showing with 3 additions and 2 deletions.
  1. +2 −1 README.md
  2. +1 −1 lib/multi-node.js
View
3 README.md
@@ -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
@@ -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.
-
+
View
2 lib/multi-node.js
@@ -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);

0 comments on commit 4e5e2be

Please sign in to comment.
Something went wrong with that request. Please try again.