Package Exports
- @parasaurolophus/node-red-dnssd
- @parasaurolophus/node-red-dnssd/dnssd.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@parasaurolophus/node-red-dnssd) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@parasaurolophus/node-red-dnssd
Wrap @gravitysoftware/dnssd for use in Node-RED.
This provides a superset of the functionality supported by node-red-node-discovery, without generating any warnings in the Node-RED log.
dnssd-browser
Input
- none
Outputs
- Stream of
Browser.serviceUp()
events - Stream of
Browser.serviceDown()
events - Stream of
Browser.error()
events
dnssd-advertisement
Input
msg.payload.command
specifies a dnssd.Advertisement
method to invoke:
start
Broadcast a "service up" event.
{ "payload": { "command": "start" } }
stop
Broadcast a "service down" event.
{ "payload": { "command": "stop" } }
updateTXT
Update the TXT
record. (Note that this is provided for completeness but is of
limited utility since it does not trigger any of the events exposed by the
dnssd.Browser
object.)
{
"payload": {
"command": "updateTXT",
"txt": {
"foo": "bar"
}
}
}
Outputs
- Stream of
Advertiser.instanceRenamed()
events - Stream of
Advertiser.hostRenamed()
events - Stream of
Advertiser.stopped()
events - Stream of
Advertiser.error()
events
Details
This is a deliberately thin wrapper around the functionality exposed by @gravitysoftware/dnssd, which is a pure JavaScript implementation of DNS-SD.
The Service configuration string is the name of the DNS-SD service to
broadcast using dnssd-advertisement
or watch using dnssd-browser
.
By default, these nodes will use TCP. The Use UDP? configuration checkbox tells them to use UDP instead.
dnssd-advertisement
also requires a Port number and can optionally take
Options, including a txt
record. Options may be specified using JSON or
JSONata.
While dnssd-browser
nodes start listening automatically when flows start,
dnssd-advertiser
nodes must be started explicitly by sending a msg
with
command
set to start
to their inputs:
{ "payload" : { "command": "start" } }