@collight/dns-sd
    Preparing search index...

    Class MDNSServer

    An mDNS server that responds to DNS queries on the local network.

    Maintains a registry of published records and automatically responds to queries using the multicast-dns protocol.

    Emits:

    • responded when a response is sent to a query
    const server = new MDNSServer({}, console.error)
    server.register([{ name: '_http._tcp.local', type: 'PTR', data: 'MyService._http._tcp.local' }])

    Hierarchy

    • EventEmitter<EventMap>
      • MDNSServer
    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • options: Options

        Configuration passed to the underlying multicast-dns instance.

      Returns MDNSServer

    Methods

    • Registers a list of DNS records to be used in future responses.

      Duplicate records (based on type, name, and deep equality of data) are ignored.

      Parameters

      • records: MDNSRecord[]

        An array of mDNS records to register.

      Returns void

    • Unregisters a set of previously registered DNS records.

      Matching is done by record.name only (not deeply).

      Parameters

      • records: MDNSRecord[]

        Records to remove from the server registry.

      Returns void