package ssdp
Import Path
github.com/koron/go-ssdp (on go.dev)
Dependency Relation
imports 14 packages, and imported by one package
Involved Source Files
advertise.go
announce.go
Package ssdp provides SSDP advertiser or so.
location.go
monitor.go
option.go
search.go
ssdp.go
Package-Level Type Names (total 12)
Advertiser is a server to advertise a service.
Alive announces ssdp:alive message.
Bye announces ssdp:byebye message.
Close stops advertisement.
*Advertiser : github.com/prometheus/common/expfmt.Closer
*Advertiser : io.Closer
func Advertise(st, usn string, location any, server string, maxAge int, opts ...Option) (*Advertiser, error)
AliveHandler is handler of Alive message.
AliveMessage represents SSDP's ssdp:alive message.
From is a sender of this message
Location is a property of "LOCATION"
Server is a property of "SERVER"
Type is a property of "NT"
USN is a property of "USN"
Header returns all properties in alive message.
MaxAge extracts "max-age" value from "CACHE-CONTROL" property.
ByeHandler is handler of Bye message.
ByeMessage represents SSDP's ssdp:byebye message.
From is a sender of this message
Type is a property of "NT"
USN is a property of "USN"
Header returns all properties in bye message.
LocationProvider provides address for Location header which can be reached from
"from" address network.
Location provides an address be reachable from the network located
by "from" address or "ifi" interface.
One of "from" or "ifi" must not be nil.
LocationProviderFunc
LocationProviderFunc type is an adapter to allow the use of ordinary
functions are location providers.
( LocationProviderFunc) Location(from net.Addr, ifi *net.Interface) string
LocationProviderFunc : LocationProvider
Monitor monitors SSDP's alive and byebye messages.
Alive AliveHandler
Bye ByeHandler
Options []Option
Search SearchHandler
Close closes monitoring.
Start starts to monitor SSDP messages.
*Monitor : github.com/prometheus/common/expfmt.Closer
*Monitor : io.Closer
Option is option set for SSDP API.
func AdvertiseHost() Option
func OnlySystemInterface() Option
func TTL(ttl int) Option
func Advertise(st, usn string, location any, server string, maxAge int, opts ...Option) (*Advertiser, error)
func AnnounceAlive(nt, usn string, location any, server string, maxAge int, localAddr string, opts ...Option) error
func AnnounceBye(nt, usn, localAddr string, opts ...Option) error
func Search(searchType string, waitSec int, localAddr string, opts ...Option) ([]Service, error)
SearchHandler is handler of Search message.
SearchMessage represents SSDP's ssdp:discover message.
From net.Addr
Type string
Header returns all properties in search message.
Service is discovered service.
Location is a property of "LOCATION"
Server is a property of "SERVER"
Type is a property of "ST"
USN is a property of "USN"
Header returns all properties in response of search.
MaxAge extracts "max-age" value from "CACHE-CONTROL" property.
func Search(searchType string, waitSec int, localAddr string, opts ...Option) ([]Service, error)
Package-Level Functions (total 9)
Advertise starts advertisement of service.
location should be a string or a ssdp.LocationProvider.
AdvertiseHost returns as Option that add HOST header to response for
M-SEARCH requests.
This option works with Advertise() function only.
This is added to support SmartThings.
See https://github.com/koron/go-ssdp/issues/30 for details.
AnnounceAlive sends ssdp:alive message.
location should be a string or a ssdp.LocationProvider.
AnnounceBye sends ssdp:byebye message.
OnlySystemInterface returns as Option that using only a system assigned
multicast interface.
Search searches services by SSDP.
SetMulticastRecvAddrIPv4 updates multicast address where to receive packets.
This never fail now.
SetMulticastSendAddrIPv4 updates a UDP address to send multicast packets.
This never fail now.
TTL returns as Option that set TTL for multicast packets.
Package-Level Variables (total 2)
Interfaces specify target interfaces to multicast. If no interfaces are
specified, all interfaces will be used.
Logger is default logger for SSDP module.
Package-Level Constants (total 2)
All is a search type to search all services and devices.
RootDevice is a search type to search UPnP root devices.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |