Documentation
¶
Overview ¶
Package discovery provides LAN discovery of OpenDeezer instances so a client can offer a "play on another device" picker (OpenDeezer Connect). Each instance with the control API enabled runs a small UDP responder advertising its display name + control port; a client multicasts a probe and collects replies.
Transport: IPv4 UDP multicast (group 239.255.42.99, port 7655) with a limited broadcast as a fallback for networks that filter multicast. The responder binds with SO_REUSEADDR/SO_REUSEPORT so several instances on ONE machine can all listen + answer.
Security: the responder answers only the exact probe magic, only to private/loopback/link-local sources (no internet reflection), with a tiny fixed payload (no amplification), and never carries the same-account credential (the Deezer user id) — only the display name + client + version.
Index ¶
Constants ¶
const (
// Port is the UDP port the responder listens on.
Port = 7655
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
Name string `json:"name"` // account display name (not the user id)
Addr string `json:"addr"` // control API host:port
Client string `json:"client"` // client/platform id (tui, macos, …)
Version string `json:"version"` // OpenDeezer version
}
Device is a discovered OpenDeezer instance.
func Discover ¶
Discover multicasts a probe (with a broadcast fallback) and collects replies for the given timeout. selfPort is this instance's own control port (0 if none): replies from a local address with that port are our own responder and are filtered out, so we never list ourselves. Other instances on the same host use a different control port and are kept.
type Responder ¶
type Responder struct {
// contains filtered or unexported fields
}
Responder advertises this instance until Close.