1 | [![Build Status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url]
|
2 |
|
3 | # upnpserver
|
4 | ![upnpserver icon](icon/icon_128.png)
|
5 |
|
6 |
|
7 | UpnpServer is a fast and light UPnP server written in NodeJS.
|
8 | This version does not need an external database (mysql, mongodb), it stores all information in memory.
|
9 |
|
10 |
|
11 | ## Compatibility
|
12 |
|
13 | - Freebox HD
|
14 | - Soundbridge
|
15 | - ht5streamer
|
16 | - Intel Device Validator
|
17 | - Samsung AllShare play
|
18 | - LG Smart Share
|
19 | - Android
|
20 | - VPlayer (with UPNP Plugin)
|
21 | - NX Player
|
22 |
|
23 | ## Installation
|
24 |
|
25 | $ npm install upnpserver
|
26 |
|
27 | ## Command line
|
28 |
|
29 | For command line, install [upnpserver-cli](https://github.com/oeuillot/upnpserver-cli) package.
|
30 |
|
31 | ## API Usage
|
32 |
|
33 | ```javascript
|
34 | var Server = require("upnpserver");
|
35 |
|
36 | var server = new Server({ /* configuration, see below */ }, [
|
37 | '/home/disk1',
|
38 | { path: '/home/myDisk' },
|
39 | { path: '/media/movies', mountPoint: '/My movies'},
|
40 | { path: '/media/albums', mountPoint: '/Personnal/My albums', type: 'music' }
|
41 | ]);
|
42 |
|
43 | server.start();
|
44 | ```
|
45 |
|
46 | ##Configuration
|
47 | Server constructor accepts an optional configuration object. At the moment, the following is supported:
|
48 |
|
49 | - `log` _Boolean_ Enable/disable logging. Default: false.
|
50 | - `logLevel` _String_ Specifies log level to print. Possible values: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`. Defaults to `ERROR`.
|
51 | - `name` _String_ Name of server. Default 'Node Server'
|
52 | - `uuid` _String_ UUID of server. (If not specified, a UUID v4 will be generated)
|
53 | - `hostname` _String_ Hostname to bind the server. Default: 0.0.0.0
|
54 | - `httpPort` _Number_ Http port. Default: 10293
|
55 | - `dlnaSupport` _Boolean_ Enable/disable dlna support. Default: true
|
56 | - `strict` _Boolean_ Use only official UPnP attributes. Default: false
|
57 | - `lang` _String_ Specify the language (en, fr) for virtual folder names. Default: en
|
58 | - `ssdpLog` _Boolean_ Enable log of ssdp layer. Default: false
|
59 | - `ssdpLogLevel` _String_ Log level of ssdp layer.
|
60 |
|
61 | ## Testing
|
62 | For testing purposes used *mocha* framework. To run tests, you should do this:
|
63 | ```bash
|
64 | make test
|
65 | ```
|
66 |
|
67 | ## Author
|
68 |
|
69 | Olivier Oeuillot
|
70 |
|
71 | ## Contributors
|
72 |
|
73 | https://github.com/oeuillot/upnpserver/graphs/contributors
|
74 |
|
75 | [npm-url]: https://npmjs.org/package/upnpserver
|
76 | [npm-image]: https://badge.fury.io/js/upnpserver.svg
|
77 | [npm-downloads-image]: http://img.shields.io/npm/dm/upnpserver.svg
|
78 |
|
79 | [travis-url]: https://travis-ci.org/oeuillot/upnpserver
|
80 | [travis-image]: https://api.travis-ci.org/oeuillot/upnpserver.svg?branch=master
|