From ec96d3622b89576be7ee203b624f1c48f67211ef Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 12 Apr 2017 20:33:55 +0100 Subject: [PATCH] patch mdns resolver sequence to stay working on Pi. --- io/mdns/mdns.js | 9 +++++++-- io/mdns/package.json | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/io/mdns/mdns.js b/io/mdns/mdns.js index b202018d..0e235958 100644 --- a/io/mdns/mdns.js +++ b/io/mdns/mdns.js @@ -10,13 +10,18 @@ module.exports = function(RED) { RED.nodes.createNode(this, n); this.topic = n.topic || ""; this.service = n.service; + var node = this; // var sequence = [ // mdns.rst.DNSServiceResolve(), // mdns.rst.getaddrinfo({families: [4] }) // ]; // var browser = mdns.createBrowser(this.service,{resolverSequence: sequence}); - var browser = mdns.createBrowser(this.service); - var node = this; + var sequence = [ + 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) { if (RED.settings.verbose) { node.log("here : " + service.name); } diff --git a/io/mdns/package.json b/io/mdns/package.json index 8cdf29ca..caee09f8 100644 --- a/io/mdns/package.json +++ b/io/mdns/package.json @@ -1,9 +1,9 @@ { "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.", "dependencies" : { - "mdns" : "2.3.2" + "mdns" : "~2.3.3" }, "repository" : { "type":"git",