From 97ae59f2827aa82062ff5f0d15a45b69aa74b891 Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Sun, 1 Sep 2019 20:15:38 +0300 Subject: [PATCH] fix: improved dnssd error handling Handle errors from dsnsd Advertisements and use a version of dnssd that does not throw out of band errors. Once or if https://github.com/DeMille/dnssd.js/pull/13 or something equivalent makes it to npm we should go back to the upstream version of dnssd. --- lib/mdns.js | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/mdns.js b/lib/mdns.js index 8ce7734da..52d84d2da 100644 --- a/lib/mdns.js +++ b/lib/mdns.js @@ -109,6 +109,10 @@ module.exports = function mdnsResponder (app) { type.port ) const ad = new mdns.Advertisement(type.type, type.port, options) + ad.on('error', err => { + console.log(type.type.name) + console.error(err) + }) ad.start() ads.push(ad) } diff --git a/package.json b/package.json index 9f79dc386..524496ec6 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "debug": "^4.1.0", "deep-get-set": "^1.1.0", "dev-null-stream": "0.0.1", - "dnssd": "^0.4.1", + "dnssd": "tkurki/dnssd.js#44b1347e728e2445f07c5f1aa97e00d2a89be0be", "errorhandler": "^1.3.0", "express": "^4.10.4", "express-namespace": "^0.1.1",