Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultMaxMessageBytes = 2048
)
View Source
const DefaultTimeout = 10 * time.Second
View Source
const LocalAddressHeader = "X-local-address"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { io.Closer // Do sends the request and returns the responses. numSends controls the number of times the request is sent. Do(ctx context.Context, req *http.Request, numSends int) ([]*http.Response, error) }
Client is an interface for sending HTTP over UDP requests and receive responses.
func NewClientAddr ¶
NewClientAddr creates a new HTTPUClient which will broadcast packets from the specified address, opening up a new UDP socket for the purpose
func NewClientInterfaces ¶
NewClientInterfaces creates a SSDP client that multiplexes to all multicast-capable IPv4 addresses on the host. Returns a function to clean up once the client is no longer required.
func NewHTTPUClient ¶
func NewMultiClient ¶
type Handler ¶
type Handler interface { // ServeMessage is called for each SSDP message received. peerAddr contains // the address that the message was received from. ServeMessage(r *http.Request) ([]*http.Response, error) }
Handler is the interface by which received SSDP messages are passed to handling code.
Click to show internal directories.
Click to hide internal directories.