multicast-scanner
v2.3.0
Published
Scan your local network for mDNS devices.
Downloads
171
Readme
multicast-scanner
Scan your local network for mDNS devices.
Based on xat/chromecast-scanner.
Scanner is set to scan for Chromecasts by default. Service name and type to scan for can be set when launching scan.
Defaults:
{
ttl: 7000,
interval: 2500,
full_scan: false,
name: null,
friendly_name: null,
service_name: '_googlecast._tcp.local',
service_type: 'PTR',
mdns: {}
}
The mdns
object in options is passed to multicast-dns
and can be used to alter its defaults.
Usage Example
var scanner = require('multicast-scanner');
scanner({ full_scan: true }, (err, devices) => {
if(err) return console.log(err.message);
devices.forEach(device => {
console.log(device);
});
});
/* Example Output:
{ name: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.local',
friendlyName: 'My Chromecast',
ip: '192.168.1.XXX',
port: 8009 }
*/
Installation
npm install multicast-scanner
License
MIT
Donation
If you like my work please support it by buying me a cup of coffee :grin: