Skip to content

Commit

Permalink
Allow binding to a specific interface
Browse files Browse the repository at this point in the history
statsd currently binds to all (IPv4) interfaces.  This may not always be what we want
(it's not what I want).  Sometimes we just want to bind to a private interface so that
only boxes on our local network can send us messages.

This patch lets us do that.

Note that we default to undefined.  Both dgram.js and net.js treat undefined as the
default value, ie, bind to everything.
  • Loading branch information
bluesmoon committed Oct 28, 2011
1 parent 38af5cf commit c2ab6c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stats.js
Expand Up @@ -128,8 +128,8 @@ config.configFile(process.argv[2], function (config, oldConfig) {
});
});

server.bind(config.port || 8125);
mgmtServer.listen(config.mgmt_port || 8126);
server.bind(config.port || 8125, config.address || undefined);
mgmtServer.listen(config.mgmt_port || 8126, config.mgmt_address || undefined);

var flushInterval = Number(config.flushInterval || 10000);

Expand Down

0 comments on commit c2ab6c9

Please sign in to comment.