Class: Mdns
Finds services that announce themselves with multicast DNS (Bonjour, Avahi), for a plugin's
static discover. It asks once from a random port (a "legacy unicast" query, RFC 6762 §6.7),
so it needs neither port 5353 nor a running mDNS daemon, and collects the answers for a few
seconds. Nexus must be on the same network as the services (host networking in Docker).
const servers = await Mdns.browse("_home-assistant._tcp.local")
Constructors
Constructor
new Mdns():
Mdns
Returns
Mdns
Methods
browse()
staticbrowse(type,options?):Promise<MdnsService[]>
the services of a type, e.g. "_mqtt._tcp.local" ("_mqtt._tcp" gets the ".local"); an empty list when none answered. Rejects when the query can't be sent, e.g. without a route for multicast.
Parameters
type
string
options?
MdnsOptions = {}
Returns
Promise<MdnsService[]>