UpnpServer is a fast and light UPnP server written in NodeJS. This version does not need an external database (mysql, mongodb), it stores all information in memory.
$ npm install upnpserver
For command line, install upnpserver-cli package.
var Server = require("upnpserver");
var server = new Server({ /* configuration, see below */ }, [
'/home/disk1',
{ path: '/home/myDisk' },
{ path: '/media/movies', mountPoint: '/My movies'},
{ path: '/media/albums', mountPoint: '/Personnal/My albums', type: 'music' }
]);
server.start();
Server constructor accepts an optional configuration object. At the moment, the following is supported:
log
Boolean Enable/disable logging. Default: false.logLevel
String Specifies log level to print. Possible values: TRACE
, DEBUG
, INFO
, WARN
, ERROR
, FATAL
. Defaults to ERROR
.name
String Name of server. Default 'Node Server'modelName
String Model name of server. Default 'Node upnpserver'uuid
String UUID of server. (If not specified, a UUID v4 will be generated)hostname
String Hostname to bind the server. Default: 0.0.0.0httpPort
Number Http port. Default: 10293dlnaSupport
Boolean Enable/disable dlna support. Default: truestrict
Boolean Use only official UPnP attributes. Default: falselang
String Specify the language (en, fr) for virtual folder names. Default: enssdpLog
Boolean Enable log of ssdp layer. Default: falsessdpLogLevel
String Log level of ssdp layer.For testing purposes used mocha framework. To run tests, you should do this:
make test
Olivier Oeuillot