mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
patch mdns resolver sequence to stay working on Pi.
This commit is contained in:
parent
4cfd216a0c
commit
ec96d3622b
@ -10,13 +10,18 @@ module.exports = function(RED) {
|
|||||||
RED.nodes.createNode(this, n);
|
RED.nodes.createNode(this, n);
|
||||||
this.topic = n.topic || "";
|
this.topic = n.topic || "";
|
||||||
this.service = n.service;
|
this.service = n.service;
|
||||||
|
var node = this;
|
||||||
// var sequence = [
|
// var sequence = [
|
||||||
// mdns.rst.DNSServiceResolve(),
|
// mdns.rst.DNSServiceResolve(),
|
||||||
// mdns.rst.getaddrinfo({families: [4] })
|
// mdns.rst.getaddrinfo({families: [4] })
|
||||||
// ];
|
// ];
|
||||||
// var browser = mdns.createBrowser(this.service,{resolverSequence: sequence});
|
// var browser = mdns.createBrowser(this.service,{resolverSequence: sequence});
|
||||||
var browser = mdns.createBrowser(this.service);
|
var sequence = [
|
||||||
var node = this;
|
mdns.rst.DNSServiceResolve(),
|
||||||
|
'DNSServiceGetAddrInfo' in mdns.dns_sd ? mdns.rst.DNSServiceGetAddrInfo() : mdns.rst.getaddrinfo({families:[4]}),
|
||||||
|
mdns.rst.makeAddressesUnique()
|
||||||
|
];
|
||||||
|
var browser = mdns.createBrowser((this.service), {resolverSequence:sequence});
|
||||||
|
|
||||||
browser.on('serviceUp', function(service) {
|
browser.on('serviceUp', function(service) {
|
||||||
if (RED.settings.verbose) { node.log("here : " + service.name); }
|
if (RED.settings.verbose) { node.log("here : " + service.name); }
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-discovery",
|
"name" : "node-red-node-discovery",
|
||||||
"version" : "0.0.16",
|
"version" : "0.0.17",
|
||||||
"description" : "A Node-RED node that uses Bonjour / Avahi to discover nearby services.",
|
"description" : "A Node-RED node that uses Bonjour / Avahi to discover nearby services.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"mdns" : "2.3.2"
|
"mdns" : "~2.3.3"
|
||||||
},
|
},
|
||||||
"repository" : {
|
"repository" : {
|
||||||
"type":"git",
|
"type":"git",
|
||||||
|
Loading…
Reference in New Issue
Block a user