[package]
name = "str0m"
version = "0.13.0"
authors = ["Martin Algesten <martin@algesten.se>", "Hugo Tunius <h@tunius.se>", "Davide Bertola <dade@dadeb.it>"]
description = "WebRTC library in Sans-IO style"
license = "MIT OR Apache-2.0"
repository = "https://github.com/algesten/str0m"
readme = "README.md"
keywords = ["webrtc", "streaming", "video", "audio", "media"]
categories = ["web-programming", "multimedia", "network-programming"]
edition = "2021"
exclude = ["/cargo_deny.sh", "/deny.toml", "/run-fuzz.sh"]

# MSRV
rust-version = "1.81.0"

# Notes on OpenSSL
# - Vendored (static link source build) ensures version consistency and easier
#   to build but increases size.
# - Non-vendored (dynamic link) uses system libraries, reducing size but may
#   cause compatibility issues.
# Choose based on security and footprint needs.
# For large deployments sharing OS images, OS updates can be easier for
# security patching than updating statically linked software.

[features]
default = ["openssl", "vendored", "sha1", "examples"]
openssl = ["dep:openssl", "dep:openssl-sys", "dep:libc"]
vendored = ["openssl?/vendored"]
unversioned = []

# Without the sha1 feature, str0m uses the openssl sha1 impl which is slower.
sha1 = ["dep:sha1"]

# Uses native Windows API to implement cryptographic features, use instead of
# openssl and sha1.
wincrypto = ["dep:str0m-wincrypto"]

# DTLS impl made for str0m (experimental) in pure Rust.
dimpl = ["sha1", "dep:dimpl", "dep:aws-lc-rs"]

# Redacts personally identifiable information (PII) from logs debug and above
pii = []

# The examples require openssl because of rouille, not because of str0m.
# However windows fails to compile with rouille/ssl, so we can't have it on
# in the dev-dependencies.
examples = ["rouille/ssl"]

_internal_dont_use_log_stats = []
_internal_test_exports = []

[dependencies]
tracing = "0.1.37"
fastrand = "2.0.1"
sctp-proto = "0.5.0"
combine = "4.6.6"

# aws-lc-rs is used when we are using the dimpl DTLS implementation
aws-lc-rs = { version = "1", optional = true, default-features = false, features = ["aws-lc-sys", "prebuilt-nasm"] }

# Sadly no DTLS support in rustls.
openssl = { version = "0.10.70", optional = true }
openssl-sys = { version = "0.9.80", optional = true }
libc = { version = "0.2", optional = true }

# STUN
hmac = "0.12.1"
crc = "3.0.0"
serde = { version = "1.0.152", features = ["derive"] }

# DTLS made for str0m
dimpl = { version = "0.1.5", optional = true }

[target.'cfg(unix)'.dependencies]
sha1 = { version = "0.10.6", features = ["asm"], optional = true }

[target.'cfg(windows)'.dependencies]
# The ASM feature is broken on windows. Unclear where in the rust-crypto project
# we're supposed to check when it gets sorted out.
sha1 = { version = "0.10.6", optional = true }
# Windows Crypto (CNG + SChannel)
str0m-wincrypto = { version = "0.2.1", path = "wincrypto", optional = true }

[dev-dependencies]
rouille = { version = "3.6.2", features = [] }

serde_json = "1.0"
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "std"] }
systemstat = "0.2.2"
pcap-file = "2.0.0"
regex = "1.11.1"
rand = "0.9.0"

# dummy package that enables "_internal_test_exports"
_str0m_test = { path = "_str0m_test" }

[[example]]
name = "chat"
required-features = ["examples"]

[[example]]
name = "http-post"
required-features = ["examples"]
