libdice is a Zig ICE/TURN networking library built from the ground up.
It includes:
- ICE candidate/checklist/runtime flow
- TURN UDP and TURN TCP support
- consent freshness handling
- integration tests against coturn
Use libdice when you need low-level control over ICE/TURN behavior in Zig, for example:
- custom media or data transport stacks
- server-side connectivity agents
- protocol experiments where browser-only WebRTC APIs are too restrictive
If you need a complete browser-compatible WebRTC stack with SDP/session/media layers fully managed, you will likely need additional layers on top of this library.
- Create an
Agentand stream/components. - Add local and remote candidates.
- Create
IceRuntimeand attach stream(s). - Use
IceUdpRuntimeBridgeto send/receive checks in a loop. - Monitor selected pairs, nomination, and consent state.
make test
make build
zig build test-examples-smoke --summary allFor coturn-backed integration:
make integration-coturnRun the simple smoke example:
zig build run-simple-exampleOr through the demo selector:
zig build run-ice-demo -- simple --summarySee docs/DOCUMENTATION.md for architecture, usage patterns, snippets, examples, testing, and troubleshooting.