[package]
name = "moq-native"
description = "Media over QUIC - Helper library for native applications"
authors = ["Luke Curley"]
repository = "https://github.com/moq-dev/moq"
license = "MIT OR Apache-2.0"

version = "0.17.8"
edition = "2024"
rust-version.workspace = true

keywords = ["quic", "http3", "webtransport", "media", "live"]
categories = ["multimedia", "network-programming", "web-programming"]

[lib]
doctest = false

[features]
default = ["quinn", "aws-lc-rs", "websocket", "tcp", "uds"]
quinn = ["dep:quinn", "dep:web-transport-quinn", "dep:rcgen", "dep:reqwest", "dep:rustls-webpki", "watch"]
noq = ["dep:web-transport-noq", "dep:rcgen", "dep:reqwest", "dep:rustls-webpki", "watch"]
quiche = ["dep:web-transport-quiche", "dep:rcgen", "dep:reqwest", "dep:rustls-webpki", "dep:rustls-native-certs"]
# Filesystem watcher for hot-reloading on-disk TLS certs/keys; the QUIC backends imply it.
watch = ["dep:notify"]
aws-lc-rs = ["rustls/aws-lc-rs", "rcgen?/aws_lc_rs", "quinn?/rustls-aws-lc-rs"]
iroh = ["dep:web-transport-iroh", "dep:web-transport-proto"]
jemalloc = ["dep:tikv-jemallocator", "dep:tikv-jemalloc-ctl"]
websocket = ["dep:qmux"]
# Plain-TCP qmux transport (`tcp://`), no TLS. Server-side and client-side.
tcp = ["dep:qmux"]
# Unix-domain-socket qmux transport (`unix://`), unix-only. Adds peer-credential
# inspection on accept. Pulls in `tcp` (shares qmux's stream transport).
uds = ["tcp", "qmux/uds"]
ring = ["rustls/ring", "rcgen?/ring", "quinn?/rustls-ring"]
android-logcat = ["dep:tracing-android"]

[dependencies]
clap = { version = "4", features = ["derive", "env"] }
futures = "0.3"
hex = "0.4"
humantime = "2.3"
humantime-serde = "1.1"

moq-net = { workspace = true, features = ["serde"] }
notify = { version = "8", optional = true }
parking_lot = { version = "0.12", features = ["deadlock_detection"] }
qmux = { workspace = true, features = ["wss", "tls", "tcp"], optional = true }
quinn = { version = "0.11", default-features = false, features = ["platform-verifier", "runtime-tokio", "bloom"], optional = true }
rand = "0.10.1"
rcgen = { version = "0.14", default-features = false, optional = true }
reqwest = { version = "0.13", default-features = false, optional = true }
rustls = "0.23"
rustls-native-certs = { version = "0.8", optional = true }
# OS-native server-cert verifier for the rustls backends. Version matched to the
# copy quinn-proto already pulls in, to avoid duplication.
rustls-platform-verifier = "0.7"
rustls-webpki = { version = "0.103", features = ["aws-lc-rs"], optional = true }
serde = { version = "1", features = ["derive"] }
serde_with = { version = "3", features = ["hex"] }
socket2 = "0.6"
thiserror = "2"
tikv-jemalloc-ctl = { version = "0.6", optional = true }
tikv-jemallocator = { version = "0.6", features = ["profiling", "unprefixed_malloc_on_supported_platforms"], optional = true }
time = "0.3"
tokio = { workspace = true, features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
url = { version = "2", features = ["serde"] }
web-transport-iroh = { workspace = true, optional = true }
web-transport-noq = { workspace = true, optional = true }
web-transport-proto = { workspace = true, optional = true }
web-transport-quiche = { workspace = true, optional = true }
web-transport-quinn = { workspace = true, optional = true }
web-transport-trait = { workspace = true }
x509-parser = "0.18"

[target.'cfg(target_os = "android")'.dependencies]
# Android's platform verifier needs a JNI handle to the app Context (see
# `tls::init_android`); jni is the bridge. Until init runs, verification falls
# back to the bundled Mozilla roots.
jni = "0.22"
tracing-android = { version = "0.2", optional = true }
webpki-roots = "1"

[dev-dependencies]
anyhow = "1"
bytes = "1"
chrono = "0.4"
rcgen = { version = "0.14", default-features = false, features = ["pem", "aws_lc_rs"] }
tempfile = "3"
toml = "1.1"
tracing-test = "0.2"
