rustrtc 0.4.1

A high-performance real-time communication library — WebRTC, RTP/SRTP, T.38 Fax, and RTP Latching
Documentation
[package]
name = "rustrtc"
version = "0.4.1"
edition = "2024"
authors = ["jinti<shenjindi@fourz.cn>"]
repository = "https://github.com/restsend/rustrtc"
description = "A high-performance real-time communication library — WebRTC, RTP/SRTP, T.38 Fax, and RTP Latching"
readme = "README.md"
keywords = ["rtp", "srtp", "webrtc", "fax", "turn"]
categories = ["network-programming"]
license = "MIT"
exclude = ["flamegraph.svg","examples", "tests", "rustrtc_sfu.png", "output.ulaw"]

[dependencies]
anyhow = { version = "1", optional = true }
thiserror = { version = "2", default-features = false }
serde = { version = "1", default-features = false, features = ["derive", "alloc"] }
serde_json = { version = "1", default-features = false, features = ["alloc"] }
tokio = { version = "1", optional = true, features = [
    "rt-multi-thread",
    "macros",
    "sync",
    "time",
    "net",
    "io-util",
] }
tracing = { version = "0.1", default-features = false, features = ["attributes"] }
async-trait = "0.1"
bytes = { version = "1", default-features = false }
aes = "0.9.2"
ctr = "0.10"
hmac = "0.13.0"
sha1 = "0.11.0"
sha2 = "0.11.0"
md5 = { package = "md-5", version = "0.11.0" }
p256 = { version = "0.13.2", optional = true, features = ["ecdh", "std", "ecdsa", "pkcs8"] }
aes-gcm = { version = "0.10.3", default-features = false, features = ["aes", "alloc"] }
futures = { version = "0.3.32", default-features = false, features = ["alloc"] }
crc32fast = { version = "1.5.0", default-features = false }
crc32c = { version = "0.6", optional = true }
base64 = { version = "0.22.1", default-features = false, features = ["alloc"] }
local-ip-address = { version = "0.6", optional = true }
rand = { version = "0.10.1", optional = true }
parking_lot = { version = "0.12", optional = true }
socket2 = { version = "0.6", optional = true }
x509-parser = { version = "0.18.1", optional = true }
igd = { version = "0.12", optional = true, features = ["aio"] }
rcgen = { version = "0.14.8", optional = true, default-features = false, features = [
    "pem",
    "ring",
] }

[dev-dependencies]
axum = { version = "0.8", features = ["multipart"] }
turn = "0.17.1"
webrtc = "0.17.1"
reqwest = { version = "0.13", default-features = false, features = [
    "json",
    "charset",
    "http2",
    "system-proxy",
    "rustls-no-provider",
] }
webrtc-util = "0.17.1"
env_logger = "0.11.10"
dtls = "0.17.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
indicatif = "0.18.4"
rustls = { version = "0.23", default-features = false, features = [
    "ring",
    "tls12",
    "logging",
] }
hyper-rustls = { version = "0.27", default-features = false, features = [
    "http1",
    "tls12",
    "logging",
    "native-tokio",
] }
tokio-rustls = { version = "0.26", default-features = false, features = [
    "ring",
    "tls12",
    "logging",
] }
serial_test = "3.4.0"
socket2 = "0.6"
tower-http = { version = "0.6", features = ["fs"] }

[features]
default = ["std"]
# Host std support; the no_std build (WP2) currently exposes the RTP/SRTP/RTX
# data plane only — more modules graduate as their platform seams land.
std = [
    "dep:anyhow",
    "dep:tokio",
    "dep:local-ip-address",
    "dep:parking_lot",
    "dep:socket2",
    "dep:igd",
    "dep:rcgen",
    "dep:x509-parser",
    "dep:p256",
    "dep:crc32c",
    "dep:rand",
    "bytes/std",
    "bytes/serde",
]
simulator = []
t38 = []
t38-interop = []

# The T.38 benchmark imports `rustrtc::t38`, which only exists with the
# feature enabled; without this gate plain `cargo test/build` fails on it.
[[example]]
name = "t38_bench"
required-features = ["t38"]

# Local dev/test build speedups. These only apply when rustrtc is the root crate
# (e.g. `cargo test` here); downstream consumers use their own profiles. The big
# win is `split-debuginfo = "unpacked"`, which moves debug info out of the
# binary and dramatically cuts link time for the large test binary.
[profile.dev]
split-debuginfo = "unpacked"

[profile.test]
split-debuginfo = "unpacked"

# Optimized release profile for the high-throughput media/crypto hot paths.
# `fat` LTO + single codegen unit enable cross-crate inlining across the many
# small RustCrypto crates and the RTP/SRTP/SCTP hot paths.
[profile.release]
lto = "fat"
codegen-units = 1
strip = "symbols"

[profile.bench]
lto = "fat"
codegen-units = 1