parcoursup/node_modules/bonjour-service/examples/simple.js
lalBi94 7bc56c09b5 $
2023-03-05 13:23:23 +01:00

16 lines
322 B
JavaScript

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)
})