-
Notifications
You must be signed in to change notification settings - Fork 10
Multicast DNS Types
Jared Rice Sr edited this page Jul 1, 2018
·
1 revision
dWeb Library For MultiCast DNS Types, allowing for the parsing and stringifying of mDNS Service Types.
npm install @distdns/types
var mDNSTypes = require('@distdns/types')
console.log(mDNSTypes.stringify({name: 'http', protocol: 'tcp', subtypes: ['sub1', 'sub2']})) // _http._tcp._sub1._sub2
console.log(mDNSTypes.parse('_http._tcp._sub1._sub2')) // {name: 'http', protocol: 'tcp', subtypes: ['sub1', 'sub2']}
The following shorthands also exist
mDNSTypes.stringify(name, protocol, subtypes)
mDNSTypes.tcp(name, subtypes) // set protocol to tcp
mDNSTypes.udp(name, subtypes) // set protocol to udp