An implementation of the Swift Service Discovery API using DNS-based Service Discovery (DNS-SD), also known as Bonjour, Zeroconf or Avahi.
Uses the dns_sd
library, which on macOS/Windows is provided by Bonjour and on Linux requires the Avahi compatibility layer. On Ubuntu, the following package can be used:
sudo apt install libavahi-compat-libdnssd-dev
The library draws inspiration from
- https://github.com/nallick/dns_sd, a high-level Swift wrapper of
dns_sd
- MIT-licensed (Copyright (c) 2019 Purgatory Design).
- https://github.com/rhx/CDNS_SD, a simpler Swift system library wrapper for
dns_sd
- BSD-2-licensed (Copyright (c) 2016, Rene Hexel)
The following documentation on the dns_sd
library was also incredibly helpful:
- Apple's documentation archive, describing the low-level DNS-SD API
- DNS Service Discovery on Windows, providing an example-oriented overview of the library and an explanation of how the callbacks are driven