Created
September 1, 2014 22:30
-
-
Save CodeFoodPixels/ce1aaf3d0c8290324d00 to your computer and use it in GitHub Desktop.
Simple UDP listener in node
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 dgram = require('dgram'); | |
var server = dgram.createSocket('udp4'); | |
server.bind(9600); | |
server.on('message', function (message) { | |
if (message.toString().match('{"source":"kankun-plug"')) { | |
console.log(message.toString()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment