// the find
sepfy/libpeer
WebRTC Library for IoT/Embedded Device using C
libpeer is a C implementation of WebRTC aimed at microcontrollers and Linux SBCs — ESP32, Raspberry Pi, RP2040. It handles the full WebRTC stack (ICE, DTLS-SRTP, RTP, SCTP for DataChannel) using BSD sockets and mbedTLS, so it runs without a Linux-native networking stack. The target audience is embedded engineers who want browser-to-device video or data without pulling in a full Node.js signaling server or a bloated C++ WebRTC library.
WHIP signaling support is a genuinely good call — it's the emerging standard for WebRTC ingest and avoids rolling a custom signaling protocol. The dependency set (mbedtls, libsrtp, usrsctp, cJSON, FreeRTOS HTTP/MQTT) is well-chosen for constrained targets: all are small, audited, and CMake-friendly. CI includes address/UB sanitizer runs, which is not a given for embedded C projects. Having working examples for ESP32, Pico, and Raspberry Pi in-tree means you can actually validate it against real hardware before committing.
No VP8/VP9 or AV1 — H.264 only, which means you're tied to camera modules with hardware H.264 encoders; software encoding on an ESP32 is not realistic. TURN relay support exists but there's no documentation on which TURN flavors (TURNS, TCP vs UDP) are actually tested in the wild, so NAT traversal in hostile networks is an open question. The API surface in peer.h and peer_connection.h is minimal to the point of opacity — no documented threading model, no clear guidance on callback lifetimes, which will bite you when you try to integrate this into a real RTOS task structure. Test coverage is thin: five test files covering STUN, SDP, DTLS, and basic peer connection, but no ICE candidate negotiation tests or DataChannel round-trip tests.