Socket
Socket
Sign inDemoInstall

mdns-discovery

Package Overview
Dependencies
3
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.6 to 0.1.7

15

mdns-discovery.js
"use strict";
var debug = require('debug')('mdns-discovery');
var dgram = require("dgram");
var packet = require('dns-packet');
var debug = require('debug')('mdns-discovery'),
dgram = require("dgram"),
packet = require('dns-packet');

@@ -25,2 +25,3 @@ var defaultOptions = {

ttl: 64
//returnOnFirstFound: false,
//find: 'string'

@@ -115,3 +116,2 @@ };

//client.on("message", this.onMessage.bind(this));
client.on("message", function(message, rinfo) {

@@ -169,2 +169,3 @@ this.onMessage(message, rinfo);

}.bind(this));
if (readyCallback) this.readyCallback = readyCallback.bind(this);
if (timeout) this.timer = setTimeout(function() {

@@ -177,3 +178,3 @@ this.close();

}
readyCallback && readyCallback(this.found);
this.readyCallback && this.readyCallback(this.found);
}.bind(this), timeout * 1000);

@@ -198,2 +199,6 @@ return this;

});
if (this.options.returnOnFirstFound) {
this.close();
this.readyCallback(this.found);
}
}

@@ -200,0 +205,0 @@ }.bind(this));

{
"name": "mdns-discovery",
"version": "0.1.6",
"version": "0.1.7",
"description": "Multicast DNS",

@@ -18,3 +18,3 @@ "author": {

"keywords": [
"mnds",
"mdns",
"broadcast",

@@ -21,0 +21,0 @@ "datagram",

@@ -14,5 +14,11 @@ ###mnds Multicast DNS

```js
var Mdns = require('mdns-discovery');
var mdns = new Mdns({ timeout: 5, name: '_amzn-wplay._tcp.local', find: 'amzn.dmgr:'});
var mdns = new Mdns({
timeout: 4,
returnOnFirstFound: true,
name: '_amzn-wplay._tcp.local',
find: 'amzn.dmgr:'
});
mdns.run (function(res) {

@@ -19,0 +25,0 @@ res.forEach(enry) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc