[package]
name = "zenwave"
version = "0.3.0"
edition = "2024"
authors = ["Lexo Liu<me@lexo.cool>"]
repository = "https://github.com/zen-rs/zenwave"
description = "Write once, fetch anywhere"
license = "MIT"
keywords = ["http", "client", "wasm", "fetch", "websocket"]
categories = ["network-programming", "web-programming::http-client", "wasm"]
[dependencies]
http-kit = "0.4"
serde = { version = "1.0", default-features = false, features = ["derive"]}
serde_json = "1.0"
base64 = "0.22"
url = "2.5"
futures-util = { version = "0.3", features = ["io", "sink"] }
futures-channel = "0.3"
thiserror = "2.0"
futures-io = "0.3"
async-lock = "3.4"
anyhow = "1.0.100"
js-sys = "0.3.82"
http = "1.3.1"
httpdate = "1.0"
[dev-dependencies]
serde_json = "1.0"
tempfile = "3.13"
async-std = { version = "1.13", features = ["attributes"] }
tiny_http = "0.12"
[features]
default = ["default-backend", "ws"]
default-backend = ["hyper-backend", "rustls"]
hyper-native-tls = ["hyper-backend", "native-tls"]
hyper-rustls = ["hyper-backend", "rustls"]
apple-backend = []
curl-backend = ["dep:curl", "dep:blocking", "proxy"]
ws = ["dep:async-tungstenite"]
native-tls = ["dep:async-native-tls", "dep:native-tls", "async-tungstenite?/async-native-tls"]
rustls = [
"dep:futures-rustls",
"dep:rustls",
"dep:webpki-roots",
"dep:rustls-native-certs",
]
hyper-backend = [
"dep:hyper",
"dep:http-body-util",
]
proxy = []
[target.'cfg(target_arch = "wasm32")'.dependencies]
web-sys = { version = "0.3", features = [
"Window",
"Request",
"RequestInit",
"Headers",
"ReadableStream",
"Response",
"WebSocket",
"MessageEvent",
"CloseEvent",
"ErrorEvent",
"BinaryType",
] }
wasm-streams = "0.4.2"
wasm-bindgen = "0.2.105"
wasm-bindgen-futures = "0.4.55"
gloo-timers = { version = "0.3", features = ["futures"] }
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
async-io = "2.4"
async-net = "2.0"
blocking = { version = "1.6", optional = true }
curl = { version = "0.4", optional = true }
executor-core = { version = "0.7.0" }
hyper = { version = "1.8", default-features = false, features = ["client", "http1"], optional = true }
http-body-util = { version = "0.1.3", optional = true }
async-native-tls = { version = "0.5.0", optional = true, default-features = false, features = ["runtime-async-std"] }
futures-rustls = { version = "0.26", optional = true }
rustls = { version = "0.23", optional = true, default-features = false, features = ["std", "tls12"] }
rustls-native-certs = { version = "0.8", optional = true }
native-tls = { version = "0.2", optional = true }
webpki-roots = { version = "1.0", optional = true }
async-tungstenite = { version = "0.32.0", default-features = false, features = ["async-std-runtime"], optional = true }
async-fs = { version = "2.2.0", default-features = false }
dirs = "6.0"
once_cell = "1.19"
time = "0.3"
tower-service = "0.3"
[target.'cfg(target_vendor = "apple")'.dependencies]
block = "0.1"
objc = "0.2"
[[example]]
name = "basic_get"
required-features = ["hyper-backend"]
[[example]]
name = "custom_client"
required-features = ["hyper-backend"]
[[example]]
name = "websocket_echo"
required-features = ["hyper-backend", "ws"]
[lints]
rust.missing_docs = "warn"
rust.missing_debug_implementations = "warn"
rust.unexpected_cfgs = "allow"
clippy.all = "warn"
clippy.style = "warn"
clippy.correctness = "warn"
clippy.complexity = "warn"
clippy.suspicious = "warn"
clippy.perf = "warn"
clippy.pedantic = "warn"
clippy.nursery = "warn"
clippy.cargo = "allow"