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.8 to 0.1.9

18

mdns-discovery.js

@@ -181,2 +181,17 @@ "use strict";

MulticastDNS.prototype.setFilter = function (propName, arr) {
if (typeof propName === 'function') {
this.validFilter = propName.bind(this);
return this;
}
this.validFilter = function(a) {
var bo = arr.find(function(v) {
return v[propName] === a[propName]
});
return !bo;
};
return this;
};
MulticastDNS.prototype.onPacket = function (packets, rinfo) {

@@ -188,2 +203,3 @@ //this.options.find = 'amzn.dmgr:';

if (a.name.indexOf(this.options.find) === 0) {
if (this.validFilter && !this.validFilter({ ip: rinfo.address })) return;
var found = this.found.find(function(v) {

@@ -193,2 +209,3 @@ return v.ip === rinfo.address;

if (found) return;
this.found.push({

@@ -213,2 +230,3 @@ ip: rinfo.address,

case 'message': this.__proto__.onMessage = fn; break;
case 'filter': this.validFilter = fn; break;
}

@@ -215,0 +233,0 @@ return this;

2

package.json
{
"name": "mdns-discovery",
"version": "0.1.8",
"version": "0.1.9",
"description": "Multicast DNS",

@@ -5,0 +5,0 @@ "author": {

@@ -1,2 +0,2 @@

###mnds Multicast DNS
###mdns Multicast DNS
<!--

@@ -56,1 +56,22 @@ [![Tests](http://img.shields.io/travis/soef/soef/master.svg)](https://travis-ci.org/soef/soef)

```
Filter:
```js
var mdns = require('mdns-discovery')();
var mdns = Mdns({
timeout: 3,
name: '_amzn-wplay._tcp.local',
find: 'amzn.dmgr:'
});
var allreadyUsed = [ {ip: '192.168.1.94'}, {ip: '192.168.1.91'} ];
mdns.setFilter('ip', allreadyUsed).run (function(res) {
res.forEach(function(v) {
console.log(v);
});
});
```
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