Runtime-agnostic async mDNS / DNS-SD — responder, querier, and DNS-SD
discovery for tokio and smol.
Introduction
hick-reactor is an async mDNS driver: it wires the Sans-I/O core
(mdns-proto) to multicast sockets (hick-udp) and runs the protocol on a
spawned driver task. The task is generic over an agnostic-net Net
implementation, so a single codebase serves both the tokio and smol
runtimes.
mDNS (Multicast DNS) discovers services on the local link with no central DNS server. Note that many cloud and shared-infrastructure networks block multicast, so mDNS is best suited to office, home, or private networks.
For a batteries-included entry point, use the hick facade (it defaults to
this driver). For the compio thread-per-core runtime, use hick-compio.
Installation
[]
= "0.6" # tokio by default
For smol instead of tokio:
[]
= { = "0.6", = false, = ["smol"] }
Example
use ;
async
Feature flags
tokio(default) —tokioruntime viaagnostic-net.smol—smolruntime.tracing— forward structuredtracingspans/events from the driver and the proto core.stats— enableno_std-safe atomic counters; read a snapshot viaendpoint.stats().metrics— bridge counters to themetricsfacade (Prometheus/StatsD). Impliesstats.
Observability
tracing
Enable features = ["tracing"] and install a subscriber. The driver emits
tracing events during socket I/O, protocol state transitions, and errors.
stats and metrics
Enable features = ["stats"] and call endpoint.stats() to obtain a
hick_trace::stats::StatsSnapshot:
let snap = endpoint.stats;
println!;
Enable features = ["metrics"] to additionally forward every counter/gauge
update to the metrics facade automatically.
The hick family
hick (facade) · mdns-proto (Sans-I/O core) · hick-udp (UDP) ·
hick-reactor (this crate) · hick-compio (compio driver) ·
hick-smoltcp (smoltcp engine) · hick-embassy (embassy driver).
Pedigree
A port and refactor of HashiCorp's mdns; the wire format and protocol state machines are an independent, panic-free reimplementation.
License
hick-reactor is under the terms of both the MIT license and the Apache
License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2025 Al Liu.