A library that implements the client side of SSDP (Simple Service Discovery Protocol).
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2013-09-27 13:15:04 -07:00
test_responses added test for parsing description.xml from ssdp devices 2013-09-24 14:38:02 -07:00
device.go no longer camelcase acronyms 2013-09-27 13:15:04 -07:00
device_test.go no longer camelcase acronyms 2013-09-27 13:15:04 -07:00
LICENSE Added license and readme. 2013-09-18 15:15:54 -07:00
README.md no longer camelcase acronyms 2013-09-27 13:15:04 -07:00
ssdp.go renamed files to ssdp 2013-09-24 13:13:25 -07:00
ssdp_test.go renamed files to ssdp 2013-09-24 13:13:25 -07:00

go-ssdp

A library that implements the client side of SSDP (Simple Service Discovery Protocol).

Please see godoc.org for a detailed API description.

Usage

Get Device for devices on the network

package main

import (
	"github.com/bcurren/go-ssdp"
	"time"
	"fmt"
)

func main() {
	devices, err := ssdp.SearchForDevices("upnp:rootdevice", 3*time.Second)
	if err != nil {
		return
	}

	for _, device := range devices {
		fmt.Println(device.ModelName)
	}
}

Get Responses for Search on the network

package main

import (
	"github.com/bcurren/go-ssdp"
	"time"
	"fmt"
)

func main() {
	responses, err := ssdp.Search("upnp:rootdevice", 3*time.Second)
	if err != nil {
		return
	}

	for _, response := range responses {
		// Do something with the response you discover
		fmt.Println(response)
	}
}

How to contribute

  • Fork
  • Write tests and code
  • Run go fmt
  • Submit a pull request