Skip to content

Commit

Permalink
properly use ipv6 config when starting proxy, adds extra keys to exam…
Browse files Browse the repository at this point in the history
…pleProxyConfig.
  • Loading branch information
coykitten committed Mar 23, 2016
1 parent cd90200 commit f417a91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion exampleProxyConfig.js
Expand Up @@ -3,6 +3,8 @@
Required Variables:
port: StatsD Cluster Proxy listening port [default: 8125]
mgmt_port: StatsD Cluster Proxy telnet management port [default: 8126]
mgmt_address: address to run the management TCP interface on [default: 0.0.0.0]
nodes: list of StatsD instances
host: address of an instance of StatsD
port: port that this instance is listening on
Expand Down Expand Up @@ -30,9 +32,9 @@ nodes: [
{host: '127.0.0.1', port: 8131, adminport: 8132}
],
server: './servers/udp',

host: '0.0.0.0',
port: 8125,
mgmt_port: 8126,
forkCount: 0,
checkInterval: 1000,
cacheSize: 10000
Expand Down
8 changes: 2 additions & 6 deletions proxy.js
Expand Up @@ -21,8 +21,8 @@ var l; // logger

configlib.configFile(process.argv[2], function (conf, oldConfig) {
config = conf;
var udp_version = config.udp_version
, nodes = config.nodes;
var udp_version = config.address_ipv6 ? 'udp6' : 'udp4';
var nodes = config.nodes;
l = new logger.Logger(config.log || {});

var forkCount = config.forkCount;
Expand Down Expand Up @@ -134,7 +134,6 @@ configlib.configFile(process.argv[2], function (conf, oldConfig) {
}
}
});

var client = dgram.createSocket(udp_version);
// Listen for the send message, and process the metric key and msg
packet.on('send', function(key, msg) {
Expand All @@ -152,9 +151,6 @@ configlib.configFile(process.argv[2], function (conf, oldConfig) {
}
});

// Bind the listening udp server to the configured port and host
server.bind(config.port, config.host || undefined);

mgmt_server.start(
config,
function(cmd, parameters, stream) {
Expand Down

0 comments on commit f417a91

Please sign in to comment.