peer-ssdp
peer-ssdp is a simple Node.js module implementing the Simple Service Discovery Protocol SSDP as described in the UPnP Device Architecture specification, Section 1
Setup
- use
npm install peer-ssdp
to install the module. - run example with
node node_modules/peer-ssdp/test/ssdp-test.js
Usage
Peer is an EventEmitter
so you can use the common EventEmitter
API to subscribe to specific events.
var ssdp = ;var peer = ssdp;var interval;/** * handle peer ready event. This event will be emitted after `peer.start()` is called. */peer; // handle SSDP NOTIFY messages. // param headers is JSON object containing the headers of the SSDP NOTIFY message as key-value-pair. // param address is the socket address of the senderpeer; // handle SSDP M-SEARCH messages. // param headers is JSON object containing the headers of the SSDP M-SEARCH message as key-value-pair. // param address is the socket address of the senderpeer; // handle SSDP HTTP 200 OK messages. // param headers is JSON object containing the headers of the SSDP HTTP 200 OK message as key-value-pair. // param address is the socket address of the senderpeer; // handle peer close event. This event will be emitted after `peer.close()` is called.peer; // Start peer. Afer peer is ready the `ready` event will be emitted.peerstart;
License
Free for non commercial use released under the GNU Lesser General Public License v3.0 , See LICENSE file.
Contact us for commecial use famecontact@fokus.fraunhofer.de
Copyright (c) 2013 Fraunhofer FOKUS