[package] name = "session-rs" version = "0.2.1" edition = "2024" description = "A lightweight async request/response and notification protocol over WebSockets" license = "Apache-2.0" repository = "https://git.selimaj.dev/selimaj-dev/session-rs" [features] default = ["server", "client"] # `SessionServer`: a standalone tokio-tungstenite WebSocket server. server = ["dep:tokio-tungstenite", "tokio/net"] # `Session::connect`: a tokio-tungstenite WebSocket client (ws:// only without a TLS feature). client = ["dep:tokio-tungstenite", "tokio-tungstenite/connect"] # `wss://` support for the client. rustls = ["client", "tokio-tungstenite/rustls-tls-webpki-roots"] native-tls = ["client", "tokio-tungstenite/native-tls"] # `Session::from_axum`: run a session on an axum WebSocket upgrade. axum = ["dep:axum"] [dependencies] futures-util = { version = "0.3.34", default-features = false, features = ["sink", "std"] } serde = { version = "1.0.228", features = ["derive"] } serde_json = "1.0.149" tokio = { version = "1.49.0", features = ["macros", "rt", "sync", "time"] } tokio-tungstenite = { version = "0.30.0", default-features = false, features = ["handshake"], optional = true } axum = { version = "0.8.9", default-features = false, features = ["ws"], optional = true } [dev-dependencies] tokio = { version = "1.49.0", features = ["macros", "rt-multi-thread", "net", "time", "io-util"] } axum = { version = "0.8.9", features = ["ws"] } [[example]] name = "axum" required-features = ["axum"] [package.metadata.docs.rs] all-features = true