diff --git a/main.js b/main.js index 32da88a..b01ace4 100644 --- a/main.js +++ b/main.js @@ -174,7 +174,7 @@ function replyLocallyWithRemoteDevicesData(name,type,query) { class: 'IN', ttl: 120, // Convert plain string to buffer; required by mdns-server - data: Buffer.from(db.remote.services[name].TXT, 'utf8') + data: r.TXT.map(entry=>Buffer.from(entry.data,'utf8')) }); } // 5. Many mDNS tools (like Avahi or Bonjour) send type: 'ANY' queries to discover all records for a name. @@ -191,7 +191,7 @@ function replyLocallyWithRemoteDevicesData(name,type,query) { if (db.remote.services[name]) { const r = db.remote.services[name]; if (r.SRV) answers.push({ name, type: 'SRV', class: 'IN', ttl: 120, data: r.SRV }); - if (r.TXT) answers.push({ name, type: 'TXT', class: 'IN', ttl: 120, data: r.TXT.map(entry=>Buffer.from(entry.data)) }); + if (r.TXT) answers.push({ name, type: 'TXT', class: 'IN', ttl: 120, data: r.TXT.map(entry=>Buffer.from(entry.data,'utf8')) }); } }