example

command
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

README

Example: Simple UPnP Server

In this example a simple UPnP server is implemented serving just two songs. The songs are taken from Small Colins album Entry, licensed under CC-BY-4.0.

The server only implements the ContentDirectory service and only its required actions. The defintions of the server device and the ContentDirectory service are taken from XML files (devicedesc.xml and contentdirectory.xml).

To run the server, just clone this repository, navigate into the folder example. Build the server:

go build

And start it:

./example

Now, it should appear in your UPnP client as "go-upnp test server". You can stop the server by pressing the ENTER key.

The server consists of a single file only. Most of it contains boilerplate code, for example code to provide handlers for the SOAP actions that are required by the UPnP standard. The interesting parts are ...

  • the browse function since it implements the browse action of the ContentDirectory service and
  • the HTTP handler functions since they implement a general HTML page for the server and the transfer of the music files.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL