A DNS Service Discovery implementation in modern TypeScript




A DNS Service Discovery implementation in modern TypeScript
This is a rewrite of the bonjour-service library that fixes multiple
issues and applies latest TypeScript best practice
``bash`
pnpm i @collight/dns-sd
`bash
pnpm i
$3
`ts
import { dnssd } from '@collight/dns-sd';const dnssd = new DNSSD();
// advertise an HTTP server on port 3000
dnssd.publish({ name: 'My Web Server', type: 'http', port: 3000 });
// browse for all http services
const browser = dnssd.startBrowser({ filter: { protocol: 'tcp', type: 'http' } }, s => {
console.log('Found an HTTP server:', s);
});
`$3
http://collight.gitlab.io/dns-sd
Development
`bash
pnpm ipnpm format && pnpm lint
pnpm build && pnpm test
pnpm doc
``MIT