ewebsock 0.8.0

WebSocket client that works natively and on the web (WASM)
Documentation
[package]
name = "ewebsock"
version = "0.8.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "WebSocket client that works natively and on the web (WASM)"
edition = "2021"
rust-version = "1.76"
license = "MIT OR Apache-2.0"
readme = "../README.md"
homepage = "https://github.com/rerun-io/ewebsock"
repository = "https://github.com/rerun-io/ewebsock"
categories = ["web-programming", "wasm"]
keywords = ["websocket", "websockets", "portable", "native", "web"]
include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml"]

[package.metadata.docs.rs]
all-features = true
targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]

[lints]
workspace = true

[features]
default = []

tls = ["tungstenite/rustls-tls-webpki-roots"]

## Opt-in to the tokio executor.
##
## This adds a lot of dependencies,
## but may yield lower latency and CPU usage
## when using `ws_connect`.
##
## Will ignore any `ControlFlow::Break` returned from the `on_event` callback.
tokio = [
  "dep:async-stream",
  "dep:futures",
  "dep:futures-util",
  "dep:tokio",
  "dep:tokio-tungstenite",
]


[dependencies]
document-features.workspace = true
log.workspace = true

# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tungstenite.workspace = true

# Optional dependencies for feature "tokio":
async-stream = { workspace = true, optional = true }
futures = { workspace = true, optional = true }
futures-util = { workspace = true, optional = true, default-features = false, features = [
  "sink",
  "std",
] }
tokio = { workspace = true, features = ["rt", "sync"], optional = true }
tokio-tungstenite = { workspace = true, optional = true }

# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys.workspace = true
wasm-bindgen.workspace = true
wasm-bindgen-futures.workspace = true
web-sys = { workspace = true, features = [
  "BinaryType",
  "Blob",
  "ErrorEvent",
  "FileReader",
  "MessageEvent",
  "ProgressEvent",
  "WebSocket",
] }