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.

16 lines
322 B

2 years ago
const { Bonjour } = require('../dist')
const service = new Bonjour()
service.publish({ name: 'My Web Server', type: 'http', port: 3000 })
const browser = service.find({ type: 'http' })
browser.on('up', (service) => {
console.log('up', service)
})
browser.on('down', (service) => {
console.log('down', service)
})