Skip to content
forked from bcurren/go-ssdp

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

License

Notifications You must be signed in to change notification settings

Oleaintueri/gossdp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go SSDP client

GitHub GitHub go.mod Go version GitHub tag (latest SemVer)

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

This is an altered version from the original by Ben Curren.

Build with ❤️ by

Oleaintueri is sponsoring the development and maintenance of this project within their organisation.

Getting Started

Installation

GOMODULE111=on go get github.com/Oleaintueri/gossdp

Usage

package main

import (
	"fmt"
	"github.com/Oleaintueri/gossdp"
	"github.com/Oleaintueri/gossdp/pkg/ssdp"
	"time"
)

func main() {
	ssdpClient := ssdp.NewSSDP(ssdp.WithTimeout(1000))

	// Get the devices on the network directly
	devices, err := ssdpClient.SearchDevices("upnp:rootdevice")

	if err != nil {
		panic(err)
	}

	// Get the general responses on the network
	responses, err := ssdpClient.Search("upnp:rootdevice")

	if err != nil {
		panic(err)
	}

	for _, device := range devices {
		fmt.Printf("Device: %v", device)
	}

	for _, resp := range responses {
		fmt.Printf("Response: %v", resp)
	}
}

How to contribute

  • Fork the repository
  • Create an issue with your desired update
  • Write tests and code
  • 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

 
 
 

Languages

  • Go 100.0%