[package]
name = "brainwires-proxy"
description = "Protocol-agnostic proxy framework for debugging app traffic"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
repository.workspace = true
homepage.workspace = true
authors.workspace = true
readme = "README.md"
documentation = "https://docs.rs/brainwires-proxy"
keywords = ["proxy", "debugging", "traffic", "http", "protocol"]
categories = ["network-programming", "development-tools::debugging"]

[dependencies]
# Async runtime
tokio = { version = "1.43", features = ["net", "sync", "rt", "macros", "io-util", "time"] }
futures = { workspace = true }
async-trait = { workspace = true }
async-stream = { workspace = true }

# Serialization
serde = { workspace = true }
serde_json = { workspace = true }

# Error handling
anyhow = { workspace = true }
thiserror = { workspace = true }

# Identifiers & time
uuid = { version = "1", features = ["v4", "serde"] }
chrono = { workspace = true }

# Logging
tracing = { workspace = true }

# URL parsing
url = { workspace = true }

# Byte buffers
bytes = "1"

# HTTP types (Method, StatusCode, HeaderMap, Uri)
http = "1.1"

# HTTP transport (feature-gated)
hyper = { version = "1", features = ["server", "client", "http1", "http2"], optional = true }
hyper-util = { version = "0.1", features = ["tokio", "server-auto", "client-legacy"], optional = true }
http-body-util = { version = "0.1", optional = true }

# WebSocket transport (feature-gated)
tokio-tungstenite = { workspace = true, optional = true }

# TLS support (feature-gated)
tokio-rustls = { version = "0.26", optional = true }
rustls-pemfile = { version = "2", optional = true }

[[example]]
name = "anthropic_openai_proxy"
path = "examples/anthropic_openai_proxy/main.rs"
required-features = ["http"]

[dev-dependencies]
tokio = { version = "1.43", features = ["full", "test-util"] }
tempfile.workspace = true
sha2 = { workspace = true }
clap = { version = "4", features = ["derive"] }
tracing-subscriber = { workspace = true }
rand = { workspace = true }

[features]
default = ["http"]
http = ["dep:hyper", "dep:hyper-util", "dep:http-body-util"]
websocket = ["dep:tokio-tungstenite"]
tls = ["dep:tokio-rustls", "dep:rustls-pemfile"]
inspector-api = ["http"]
full = ["http", "websocket", "tls", "inspector-api"]
