No library needed to install UDP, except the audio "play" basically npm install playCode:var PORT = 44126; var HOST = '127.1.1.1'; var client = dgram.createSocket('udp4'); var play = require('play'); client.on('listening', function () { var address = client.address(); console.log('UDP Server listening on ' + address.address + ":" + address.port); }); client.on('message', function (message, remote) { console.log(remote.address + ':' + remote.port +' - ' + message); play.sound('./sound-files/ring.wav'); }); //calling client.send(message, 0, message.length, PORT, HOST, function(err, bytes) { if (err) throw err; console.log('UDP message sent to ' + HOST +':'+ PORT); });
Results 1 to 30 of 97
Threaded View
-
03-17-2018
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)