[package]
name = "nexus-net"
version = "0.4.1"
description = "Low-latency WebSocket, HTTP/1.1, and TLS primitives. Sans-IO, zero-copy, SIMD-accelerated."
readme = "README.md"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true

[features]
default = []
full = ["tls", "socket-opts", "bytes"]
tls = ["dep:rustls", "dep:rustls-native-certs"]
socket-opts = ["dep:socket2"]
bytes = ["dep:bytes"]
tokio = ["dep:tokio"]

[package.metadata.docs.rs]
all-features = true

[dependencies]
httparse = "1"
sha1 = "0.10"
simdutf8 = "0.1"
getrandom = "0.3"
bytes = { version = "1", optional = true }
rustls = { version = "0.23", default-features = false, features = ["std", "tls12", "aws_lc_rs"], optional = true }
rustls-native-certs = { version = "0.8", optional = true }
socket2 = { version = "0.5", optional = true }
tokio = { version = "1", features = ["io-util", "net", "rt", "time"], optional = true }

[[example]]
name = "perf_buf"

[[example]]
name = "perf_ws"

[[example]]
name = "perf_vs_tungstenite"

[[example]]
name = "perf_tls"
required-features = ["tls"]

[[example]]
name = "perf_throughput"
required-features = ["tls"]

[[example]]
name = "perf_rest"

[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
tungstenite = { version = "0.29", features = ["rustls-tls-native-roots"] }
tokio-tungstenite = "0.26"
tokio = { version = "1", features = ["rt", "net", "io-util", "time", "macros"] }
reqwest = { version = "0.12", features = ["blocking", "json"] }
nexus-async-net = { path = "../nexus-async-net" }
futures-util = "0.3"
hdrhistogram = { workspace = true }
rcgen = "0.13"
rustls = { version = "0.23", features = ["std", "tls12", "aws_lc_rs"] }
rustls-pemfile = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sonic-rs = "0.3"

[[bench]]
name = "frame_reader"
harness = false

[[bench]]
name = "frame_writer"
harness = false

[[bench]]
name = "rest"
harness = false

[lints]
workspace = true
