Skip to content

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

License

Notifications You must be signed in to change notification settings

bcurren/go-ssdp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages