udp_prague is a near-literal Rust port of the original C++ UDP Prague example project.
The core Prague congestion-control logic, packet formats, and socket/runtime pieces intentionally stay close to the C++ reference so parity work remains straightforward.
On top of that port, the crate adds optional Rust-facing session wrappers plus repository tooling for validation, parity checks, and basic measurements.
Use the crate in two main ways:
- as a reusable Rust crate for your own transport, media, or messaging code
- as a demo sender/receiver setup for parity checks, validation, and basic measurements
If you are new to the codebase, enable the session feature and start with the session wrappers in udp_prague::core. If you need the closest match to the original example project, use the lower-level controller, packet, and runner APIs.
If you are exploring the repository for the first time, read the docs in this order:
- docs/embedding-guide.md: start here for API selection, library integration, and end-to-end examples
- docs/benchmarking-and-validation.md: use this for demo binaries, Rust-vs-C++ checks, and reproducible validation commands
- docs/compatibility.md: read this if you need parity details against the original C++ project
The crate has three public layers:
- base Prague runtime: always available
session: high-level sender/receiver wrapper APIs for embedding applicationsdemo-app: reference-style CLI, config parsing, reporting, and demo binaries
Pick a Cargo source the same way you would for any Rust dependency: version, git, or path. The feature recipes below stay the same regardless of which source you use.
If you want only the base Prague runtime:
[dependencies]
udp_prague = { version = "0.1.0", default-features = false }If you want the wrapper layer without the demo binaries, enable only session:
[dependencies]
udp_prague = { version = "0.1.0", default-features = false, features = ["session"] }If you want the full feature set, enable both optional layers explicitly:
[dependencies]
udp_prague = { version = "0.1.0", default-features = false, features = ["session", "demo-app"] }If you prefer an unreleased checkout, keep the same shape and replace version = "0.1.0" with git = "https://github.com/mcabla/udp_prague.git" or a local path = "...".
The default feature set currently enables session and demo-app for compatibility, but production integrations are usually clearer when they declare the feature set explicitly.
If you are evaluating the source tree itself, these are useful first commands:
cargo test --no-default-features
cargo test --no-default-features --features session
cargo test --all-features
cargo run --bin udp_prague_sender -- --help
cargo run --bin udp_prague_receiver -- --helpFor API walkthroughs and embedding examples, continue with docs/embedding-guide.md.
The upstream C++ tree is only needed for cross-language comparison and benchmarking. The helper scripts can clone or refresh a pinned checkout automatically when you need it. See docs/benchmarking-and-validation.md for the step-by-step workflow.