Skip to content

Instantly share code, notes, and snippets.

View kburman's full-sized avatar

Kshitij Burman kburman

View GitHub Profile
var dgram = require('dgram');
var socket = dgram.createSocket('udp4');
var testMessage = "[hello world] pid: " + process.pid;
var broadcastAddress = '255.255.255.255';
var broadcastPort = 5555;
socket.setBroadcast(true);
socket.bind(broadcastPort, '0.0.0.0');