yuppie is a library that supports building UPnP servers in Go
Run go get -u gitlab.com/mipimipi/yuppie
.
You can focus on the specific application logic of your server and don't have to bother with all the generic UPnP stuff. yuppie takes care of ...
- Device discovery, i.e. SSDP notifications and search responses
- Provisioning of device and service descriptions
- Management of state variables
- Eventing
- Receipt and verification of service control calls, sending of responses
The yuppie server requires ...
- a device description
- service descriptions
- handler functions for HTTP and SOAP action calls
This example shows how a simple UPnP music server can be built with yuppie. You find more detailed information about how to use yuppie to build a server here.
The yuppie server requires a device and service descriptions. These descriptions can come from XML files (see [2], [3] and [4] for further information; see the example server for an example device description and an example description for a ContentDirectory service). yuppie provides functions to create the input data for the server from such files.
Besides device and service descriptions, yuppie requires a simple configuration to create a server. If no configuration is provided the default values are used:
- All network interfaces are used by the server
- The server listens on port 8008
yuppie uses logrus for logging. It uses the logrus default configuration (i.e. output on stdout with text formatter and info level). If you don't want that, configure the output, formatter and level in your server application. This will also be adhered to by the logging of yuppie server.
yuppie implements the UPnP Device Architecture version 2.0, except:
-
SSDP update notifications
yuppie does not send update notifications if network interfaces or server IP addresses changed. Thus, it's recommended to give the server a static IP address and to restart the server if network interfaces were changed.
-
Chunked transfer encoding that was introduced with HTTP 1.1
-
Custom UPnP data types
yuppie only supports the standard UPnP data types
-
Event subscriptions for specific state variables
yuppie only supports event subscriptions for all evented state variables
[1] UPnP Standards and Architecture
[2] UPnP Device Architecture version 2.0 (PDF)
[3] UPnP ContentDirectory Service (PDF)