How to use the multicast-dns-service-types.parse function in multicast-dns-service-types

To help you get started, we’ve selected a few multicast-dns-service-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github watson / bonjour / lib / discover.js View on Github external
.forEach(function (rr) {
          if (rr.type === 'SRV') {
            var parts = rr.name.split('.')
            service.name = parts.shift()
            service.replyDomain = parts.pop()
            service.fullName = rr.name
            service.host = rr.data.target
            service.port = rr.data.port
            service.type = serviceName.parse(parts.join('.'))
          } else if (rr.type === 'TXT') {
            service.rawTxt = rr.data
            service.txt = txt.decode(rr.data)
          }
        })
github watson / bonjour / lib / browser.js View on Github external
.forEach(function (rr) {
          if (rr.type === 'SRV') {
            var parts = rr.name.split('.')
            var name = parts[0]
            var types = serviceName.parse(parts.slice(1, -1).join('.'))
            service.name = name
            service.fqdn = rr.name
            service.host = rr.data.target
            service.referer = referer
            service.port = rr.data.port
            service.type = types.name
            service.protocol = types.protocol
            service.subtypes = types.subtypes
          } else if (rr.type === 'TXT') {
            service.rawTxt = rr.data
            service.txt = txt.decode(rr.data)
          }
        })

multicast-dns-service-types

Parse and stringify mdns service types

MIT
Latest version published 9 years ago

Package Health Score

65 / 100
Full package analysis