C++ library for Media Over QUIC peering. Relays use it to peer with each other over QUIC and forward track names, subscribes, and objects. The library implements the peering protocol. It does not implement Media Over QUIC (MoQ). An application such as LAPS implements MoQ and uses this library.
- API —
PeerManager,Delegate, and the calls an application makes - Examples —
moq_peering_relay,moq_peering_producer, andmoq_peering_subscriber, and how each one uses the API - Peering protocol — relay-to-relay wire protocol for Media Over QUIC peering
moq::peering::PeerManager is the entry point.
Methods the application calls:
Announce/Withdrawadvertise a track or a namespaceSubscribe/UpdateSubscribe/Unsubscribeexpress interestSendData/EndSubgroupforward objectsHasSubscribersreports whether any peer still wants a trackHashTrackreturns the full-name hash used by the calls above
moq::peering::Delegate is the callback interface. Peering invokes it when a peer subscribes, withdraws,
announces, delivers an object, or connects and disconnects. LAPS implements the delegate and translates
those events into MoQ.
Standalone. CMake fetches picoquic, and picoquic fetches picotls. OpenSSL is required for the TLS backend:
cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failuretest/peering_integration.cc runs relays in one process. Two edges exchange a publish, a subscribe, and a datagram in each direction. A second case puts a via between two edges. A third case attaches a stub to an edge and exchanges with a far edge through that parent. None of them open a MoQ session.
Those tests generate a short-lived self-signed P-256 certificate, check that it is currently valid and signed with SHA-256, and delete the key when the test ends. Do not embed certificate or key material in source.
From LAPS, the library is added with CPM. A checkout at ../moq-peering is used when it is present.
Otherwise CPM fetches quicr/moq-peering.
docs/examples.md documents each binary, its flags, and the PeerManager calls it makes. The short form is one edge with a producer and a subscriber:
make cert
cmake --build build --target moq_peering_relay moq_peering_producer moq_peering_subscriber
./build/examples/moq_peering_relay --cert build/server-cert.pem --key build/server-key.pem --listen 33434
./build/examples/moq_peering_producer --cert build/server-cert.pem --key build/server-key.pem --peer 127.0.0.1:33434
./build/examples/moq_peering_subscriber --cert build/server-cert.pem --key build/server-key.pem --peer 127.0.0.1:33434make cert writes a self-signed P-256 certificate signed with SHA-256 under build/. The examples read those files, check validity, key strength, and signature, and accept the self-signed pair for local use. Certificate bytes stay out of source.