#service-discovery #mdns #discovery #zeroconf #dns-sd

mdns-sd

mDNS Service Discovery library with no async runtime dependency

39 releases

0.10.5 Mar 25, 2024
0.10.3 Jan 14, 2024
0.10.2 Dec 28, 2023
0.10.0 Nov 28, 2023
0.1.0 Oct 17, 2021

#192 in Network programming

Download history 329/week @ 2023-12-23 365/week @ 2023-12-30 695/week @ 2024-01-06 592/week @ 2024-01-13 504/week @ 2024-01-20 404/week @ 2024-01-27 467/week @ 2024-02-03 982/week @ 2024-02-10 1338/week @ 2024-02-17 1284/week @ 2024-02-24 1311/week @ 2024-03-02 1419/week @ 2024-03-09 1198/week @ 2024-03-16 1407/week @ 2024-03-23 1662/week @ 2024-03-30 821/week @ 2024-04-06

5,267 downloads per month
Used in 23 crates (11 directly)

Apache-2.0 OR MIT

175KB
3.5K SLoC

mdns-sd

Build Cargo docs.rs Rust version: 1.63+

This is a small implementation of mDNS (Multicast DNS) based service discovery in safe Rust, with a small set of dependencies. Some highlights:

  • supports both the client (querier) and the server (responder) uses.
  • supports macOS, Linux and Windows.
  • supports IPv4 and IPv6.
  • works with both sync and async code.
  • no dependency on any async runtimes.

Approach

We are not using async/.await internally, instead we create a new thread to run a mDNS daemon.

The API interacts with the daemon via flume channels that work easily with both sync and async code. For more details, please see the documentation.

Compatibility and Limitations

This implementation is based on the following RFCs:

This is still beta software. We focus on the common use cases at hand. And we tested with some existing common tools (e.g. Avahi on Linux, dns-sd on MacOS, and Bonjour library on iOS) to verify the basic compatibility.

Currently this library has the following limitations:

  • Only support multicast, no unicast send/recv.

License

Licensed under either of

at your option.

Contribution

Contributions are welcome! Please open an issue in GitHub if any questions.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the above license(s), shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.7–10MB
~66K SLoC