Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
mdns-discovery
Advanced tools
Readme
###mdns Multicast DNS
####Some Examples:
Find all Amazon Fire TV devices on the local network:
var Mdns = require('mdns-discovery');
var mdns = new Mdns({
timeout: 4,
returnOnFirstFound: true,
name: '_amzn-wplay._tcp.local',
find: 'amzn.dmgr:'
});
mdns.run (function(res) {
res.forEach(enry) {
console.log(entry);
}
});
List all mdns questions and answers for 10 seconds:
var Mdns = require('mdns-discovery');
var mdns = new Mdns({ timeout: 10 });
mdns.on('packet', function (packets, rinfo) {
if (packets.answers) packets.answers.forEach(function(packet, i) {
console.log(`A: ${rinfo.address} - packet[${i}]=${packet.name}, type=${packet.type}, class=${packet.class}, ttl=${packet.ttl}}`);
});
if (packets.questions) packets.questions.forEach(function(packet, i) {
console.log(`Q: ${rinfo.address} - packet[${i}]=${packet.name}, type=${packet.type}, class=${packet.class}, ttl=${packet.ttl}}`);
});
});
mdns.run ();
Presence:
var mdns = require('mdns-discovery')();
mdns.onIP('192.168.1.31', function (packet, rinfo) {
if (packet.answers.length) {
console.log(rinfo.address + ' is present');
}
}).run ();
Filter:
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);
});
});
FAQs
Multicast DNS
The npm package mdns-discovery receives a total of 1,012 weekly downloads. As such, mdns-discovery popularity was classified as popular.
We found that mdns-discovery demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.