var SSDP = require('node-ssdp/index').Server , server = new SSDP({ //unicastHost: '192.168.11.63', description:'test', location: 'testsdfsdfsf' }) server.addUSN('upnp:rootdevice'); /*server.addUSN('urn:schemas-upnp-org:device:MediaServer:1'); server.addUSN('urn:schemas-upnp-org:service:ContentDirectory:1');*/ server.addUSN('urn:schemas-upnp-org:service:DeviceServer:1'); server.on('advertise-alive', function (headers) { // Expire old devices from your cache. // Register advertising device somewhere (as designated in http headers heads) console.log('horray'); }); server.on('advertise-bye', function (headers) { // Remove specified device from cache. }); // start the server server.start(); process.on('exit', function(){ server.stop(); // advertise shutting down and stop listening });