multicast-dns
Advanced tools
Comparing version 5.5.0 to 6.0.0
10
index.js
@@ -1,2 +0,2 @@ | ||
var packets = require('./packets') | ||
var packet = require('dns-packet') | ||
var dgram = require('dgram') | ||
@@ -36,3 +36,3 @@ var thunky = require('thunky') | ||
try { | ||
message = packets.decode(message) | ||
message = packet.decode(message) | ||
} catch (err) { | ||
@@ -72,4 +72,4 @@ that.emit('warning', err) | ||
that.send = function (packet, rinfo, cb) { | ||
if (typeof rinfo === 'function') return that.send(packet, null, rinfo) | ||
that.send = function (value, rinfo, cb) { | ||
if (typeof rinfo === 'function') return that.send(value, null, rinfo) | ||
if (!cb) cb = noop | ||
@@ -79,3 +79,3 @@ if (!rinfo) rinfo = me | ||
if (err) return cb(err) | ||
var message = packets.encode(packet) | ||
var message = packet.encode(value) | ||
socket.send(message, 0, message.length, rinfo.port, rinfo.address || rinfo.host, cb) | ||
@@ -82,0 +82,0 @@ }) |
{ | ||
"name": "multicast-dns", | ||
"version": "5.5.0", | ||
"version": "6.0.0", | ||
"description": "Low level multicast-dns implementation in pure javascript", | ||
@@ -11,4 +11,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"thunky": "^0.1.0", | ||
"ip": "^1.1.0" | ||
"dns-packet": "^1.0.1", | ||
"thunky": "^0.1.0" | ||
}, | ||
@@ -15,0 +15,0 @@ "devDependencies": { |
15
test.js
@@ -149,17 +149,2 @@ var mdns = require('./') | ||
test('TXT record - empty', function (dns, t) { | ||
dns.once('query', function (packet) { | ||
dns.respond([{type: 'TXT', name: 'hello-world', ttl: 120}]) | ||
}) | ||
dns.once('response', function (packet) { | ||
t.same(packet.answers[0], {type: 'TXT', name: 'hello-world', ttl: 120, data: new Buffer('00', 'hex'), class: 1, flush: false}) | ||
dns.destroy(function () { | ||
t.end() | ||
}) | ||
}) | ||
dns.query('hello-world', 'TXT') | ||
}) | ||
test('QU question bit', function (dns, t) { | ||
@@ -166,0 +151,0 @@ dns.once('query', function (packet) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16679
9
306
3
+ Addeddns-packet@^1.0.1
+ Addeddns-packet@1.3.4(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
- Removedip@^1.1.0