[package]
name = "socketioxide"
description = "Socket IO server implementation in rust as a Tower Service."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
readme = "../README.md"


[dependencies]
engineioxide = { path = "../engineioxide", version = "0.7.2" }
futures.workspace = true
tokio = { workspace = true, features = ["rt"] }
serde.workspace = true
serde_json.workspace = true
tower.workspace = true
http.workspace = true
http-body.workspace = true
thiserror.workspace = true
itoa.workspace = true

# Extensions
dashmap = { version = "5.4.0", optional = true }

# Tracing
tracing = { workspace = true, optional = true }

# Hyper v0.1
http-body-v1 = { workspace = true, optional = true }
hyper-v1 = { workspace = true, optional = true }

[features]
v4 = ["engineioxide/v3"]
test-utils = []
tracing = ["dep:tracing", "engineioxide/tracing"]
extensions = ["dep:dashmap"]
hyper-v1 = ["engineioxide/hyper-v1", "dep:http-body-v1", "dep:hyper-v1"]

[dev-dependencies]
engineioxide = { path = "../engineioxide", features = [
    "v3",
    "tracing",
    "test-utils",
] }
axum.workspace = true
salvo.workspace = true
warp.workspace = true
tokio = { workspace = true, features = [
    "macros",
    "parking_lot",
    "rt-multi-thread",
] }
tracing-subscriber.workspace = true
tokio-tungstenite = "0.20.0"
hyper = { workspace = true, features = [
    "http1",
    "http2",
    "server",
    "stream",
    "runtime",
    "client",
] }
criterion = { version = "0.5.1", features = ["html_reports"] }

# docs.rs-specific configuration
[package.metadata.docs.rs]
features = ["v4", "extensions", "hyper-v1", "tracing"]
# Special configuration for docs.rs build
rustdoc-args = ["--cfg", "docsrs"]

[[bench]]
name = "packet_encode"
path = "benches/packet_encode.rs"
harness = false

[[bench]]
name = "packet_decode"
path = "benches/packet_decode.rs"
harness = false

[[bench]]
name = "itoa_bench"
path = "benches/itoa_bench.rs"
harness = false
