Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (32 sloc) 1.165 kB
f42a467 @TooTallNate first commit
authored
1 node-upnp-client
2 ================
3 ### [UPnP][] "Control Point" Library for [NodeJS][].
4
5 A module for NodeJS written in JavaScript to interface with UPnP compliant devices.
6
7 Usage
8 -----
9
f1bc5f8 @TooTallNate README++
authored
10 This module is still ___alpha___ quality, and it's API is a work-in-progress and
11 subject to change!
f42a467 @TooTallNate first commit
authored
12
13 #### Discovery
14
f1bc5f8 @TooTallNate README++
authored
15 Discovering UPnP compliant devices on the network is usually the first step in
16 anything UPnP-related:
17
18 ``` javascript
19 var upnp = require("upnp");
20
21 // First, create a client instance
22 var controlPoint = new upnp.ControlPoint();
23
24 controlPoint.on("DeviceAvailable", function(device) {
25 console.log(device.nt);
26 //-> "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
27 console.log(device.location);
28 //-> "http://192.168.0.1/root.sxml"
29 });
30
31 controlPoint.on("DeviceFound", function(device) {
32 console.log(device.st);
33 //-> "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
34 console.log(device.location);
35 //-> "http://192.168.0.1/root.sxml"
36 }
37
38 controlPoint.search('urn:schemas-upnp-org:device:InternetGatewayDevice:1');
39 ```
f42a467 @TooTallNate first commit
authored
40
41 [UPnP]: http://upnp.org/
42 [NodeJS]: http://nodejs.org
43 [WikipediaUPnP]: http://wikipedia.org/wiki/Universal_Plug_and_Play
Something went wrong with that request. Please try again.