Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

UPnP Client Library for NodeJS. Aims to support as many device specifications as possible...

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 package.json


UPnP "Control Point" Library for NodeJS.

A module for NodeJS written in JavaScript to interface with UPnP compliant devices.

The entire range of UPnP devices aims to be supported through contributors. Currently implemented specifications are:

  • InternetGatewayDevice:1
    • WANDevice:1
      • WANIPConnection:1


This module is still alpha quality, and it's API is a work-in-progress and subject to change!


Discovering UPnP compliant devices on the network is usually the first step in anything UPnP-related:

var upnp = require("upnp");

var controlPoint = new upnp.ControlPoint();
controlPoint.on("deviceAdded", function(err, device) {
    //-> "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
    //-> ""


Once a device is "discovered", there's still not very much known about the device other than it's root device type. The loadDescription function needs to be called on a "device" object to determine which services, child devices, events, etc. the device implements. The prototype of the device object gets extended to reflect the parsed description of the device:

device.loadDescription(function(err) {
  // 'device' is now populated with a lot more properties


Invoking the services that a device exposes is probably your primary concern with interacting with a UPnP device. GetExternalIPAddress is an example of an action exposed from a WANIPConnection service:

device.GetExternalIPAddress(function(err, ip) {
    //-> ""

Event Notification

Individual device "service"s often emit their own events when certain properties of the device change. Use the notification event of Device or Service instances to invoke a callback whenever a notification is emitter from the device:

device.on("notification", function(properties) {
  for (var i in properties) {
    console.log(i + ": " + properties[i]);
Something went wrong with that request. Please try again.