You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
319 B
20 lines
319 B
|
3 years ago
|
import makeMdns from 'multicast-dns'
|
||
|
|
const mdns = makeMdns()
|
||
|
|
|
||
|
|
mdns.on('response', (response) => {
|
||
|
|
console.log('got a response packet:', response)
|
||
|
|
})
|
||
|
|
|
||
|
|
mdns.on('query', function (query) {
|
||
|
|
console.log('got a query packet:', query)
|
||
|
|
})
|
||
|
|
|
||
|
|
mdns.query({
|
||
|
|
questions: [
|
||
|
|
{
|
||
|
|
name: 'brunhilde.local',
|
||
|
|
type: 'A',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
})
|