Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdns-js

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdns-js - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

14

index.js

@@ -30,2 +30,16 @@

module.exports.excludeInterface = function (iface) {
if (networking.started) {
throw new Error('can not exclude interfaces after start');
}
if (iface === '0.0.0.0') {
networking.INADDR_ANY = false;
}
else {
var err = new Error('Not a supported interface');
err.interface = iface;
}
};
/* @borrows Advertisement as Advertisement */

@@ -32,0 +46,0 @@ module.exports.Advertisement = require('./lib/advertisement'); //just for convenience

20

lib/networking.js

@@ -24,2 +24,4 @@ var debug = require('debug')('mdns:lib:networking');

this.users = [];
this.INADDR_ANY = typeof options.INADDR_ANY === 'undefined' ?
false : options.INADDR_ANY;
};

@@ -52,4 +54,6 @@

this.createSocket(index++, 'pseudo multicast',
'0.0.0.0', 5353, this.bindToAddress.bind(this));
if (this.INADDR_ANY) {
this.createSocket(index++, 'pseudo multicast',
'0.0.0.0', 5353, this.bindToAddress.bind(this));
}
};

@@ -74,9 +78,9 @@

interfaceIndex, networkInterface, address, port, next) {
var sock;
var sock;
if (semver.gte(process.versions.node, '0.11.13')) {
sock = dgram.createSocket({type:'udp4', reuseAddr:true});
} else {
sock = dgram.createSocket('udp4');
}
if (semver.gte(process.versions.node, '0.11.13')) {
sock = dgram.createSocket({type:'udp4', reuseAddr:true});
} else {
sock = dgram.createSocket('udp4');
}
debug('creating socket for', networkInterface);

@@ -83,0 +87,0 @@ this.created++;

2

package.json
{
"name": "mdns-js",
"version": "0.3.0",
"version": "0.3.1",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

@@ -17,3 +17,3 @@ var Lab = require('lab');

before(function (done) {
// mdns.excludeInterface('0.0.0.0');
mdns.excludeInterface('0.0.0.0');
expect(mdns, 'library does not exist!?').to.exist(mdns);

@@ -20,0 +20,0 @@ browser = mdns.createBrowser();

@@ -155,3 +155,3 @@ var Lab = require('lab');

it('should work out _sub of apple-mobdev', {only: true}, function (done) {
it('should work out _sub of apple-mobdev', function (done) {
var s = new ServiceType('46c20544._sub._apple-mobdev2._tcp.local');

@@ -158,0 +158,0 @@ expect(s.name, 'name').to.equal('apple-mobdev2');

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc