Created
June 18, 2013 12:07
-
-
Save mrwillihog/5804815 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PORT = 8181, | |
STATSD_HOST = "0.0.0.0", | |
STATSD_PORT = 8125; | |
var express = require('express'), | |
dgram = require('dgram'), | |
socket = dgram.createSocket('udp4'), | |
app = express(), | |
msg; | |
app.get('/', function (request, response) { | |
request.query.stat.forEach(function (item) { | |
msg = new Buffer(item); | |
socket.send(msg, 0, msg.length, STATSD_PORT, STATSD_HOST); | |
}); | |
response.end(); | |
}); | |
app.listen(PORT); | |
console.log("Listening on port " + PORT); |
so is the url ?stat=____ then
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what's the difference between 0.0.0.0 and localhost