Optional getOptional logger?: LoggerReadonly [initProtected _groupsProtected _hostnameProtected _idProtected _localProtected _networkProtected _portProtected _unicastProtected advertisementsProtected getProtected localProtected localProtected loggerProtected networkProtected queriesProtected runningProtected socketProtected socketProtected socketsGets the multicast hostname this socket is bound to.
This will always end in .local.
Gets the id used for DNS packets. This is 16 bit.
Returns a Map of services that you have registered. The Key is a FQDN.
Returns a Map of services on the network. The Key is a FQDN.
Gets the unicast flag. This will be true if a socket is deemed able to receive unicast responses.
Protected advertiseOptional socket: MulticastSocketInfo | MulticastSocketInfo[]Protected extractProtected findProtected handleProtected handleProtected handleProtected handleProtected handleProtected processRegisters a service
Optional advertise?: booleanAllows MDNS to advertise the service on registration. Defaults to true.
The name of the service you want to register.
The port of the service you want to register.
The protocol of service you want to register. This is either 'udp' or 'tcp'.
Optional txt?: Record<string, string>The TXT data of the service you want to register. This is represented as a key-value POJO.
The type of service you want to register.
Protected sendSends a packet to the multicast groups
the packet to send
Optional sockets: MulticastSocketInfo | MulticastSocketInfo[]If sockets is not provided, the message will be sent to all multicast sockets
Protected sendSends a packet
the packet to send
the sockets to send on
the address to send to
Starts MDNS
Optional advertise?: booleanAllows MDNS to advertise it's hostnames. Defaults to true.
Optional disableOptional groups?: string[]The multicast group IP addresses to multi-cast on. This must as least have one element. This can have both IPv4 and IPv6 and must. Defaults to ['224.0.0.251', 'ff02::fb'].
Optional hostname?: stringThe hostname to use for the MDNS stack. Defaults to the OS hostname.
Optional id?: numberThe unique unsigned 16 bit integer ID used for all outgoing MDNS packets. Defaults to a random number.
Optional ipv6Makes MDNS to bind exclusively IPv6 sockets. Defaults to false.
Optional port?: numberThe port to bind to. Defaults to 5353 the default MDNS port. Defaults to 5353.
opts.groups is empty.Start a query for services of a specific type and protocol.
If there already is a query running for the type and protocol combination, it will be cancelled and restarted.
Optional maxThe maximum delay between queries in seconds. Defaults to 3600 (1 hour).
Optional minThe minimum delay between queries in seconds. Defaults to 1.
The protocol of service you want to query for. This is either 'udp' or 'tcp'.
The type of service you want to query for.
Stops a service query that you have started with startQuery
The protocol of service you want to stop querying for. This is either 'udp' or 'tcp'.
The type of service you want to stop querying for.
Un-registers a service that you have registered with registerService
The name of the service you want to unregister.
The protocol of service you want to unregister. This is either 'udp' or 'tcp'.
The type of service you want to unregister.
Generated using TypeDoc
Represents the advertisements and queries that have been cancelled and are in the process of stopping