[package] description = "WebSocket IO layer implementation for `aeronet`" name = "aeronet_websocket" authors.workspace = true categories.workspace = true edition.workspace = true keywords.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true [lints] workspace = true [package.metadata.docs.rs] all-features = true targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] [features] default = ["self-signed"] ## Enables the `client` module. client = [] ## Enables the `server` module. server = ["dep:tokio-rustls"] ## Allows generating self-signed server certificates using [`rcgen`]. ## ## [`rcgen`]: https://docs.rs/rcgen self-signed = ["dep:rcgen"] ## Enable this when generating docs. document-features = ["dep:document-features"] [dependencies] aeronet_io = { workspace = true } anyhow = { workspace = true } bytes = { workspace = true } cfg-if = { workspace = true } derive_more = { workspace = true, features = ["display", "error", "from"] } futures = { workspace = true } replace_with = { workspace = true } tracing = { workspace = true } web-time = { workspace = true } bevy_app = { workspace = true } bevy_ecs = { workspace = true } bevy_hierarchy = { workspace = true } document-features = { workspace = true, optional = true } [target.'cfg(target_family = "wasm")'.dependencies] js-sys = { workspace = true } wasm-bindgen = { workspace = true } wasm-bindgen-futures = { workspace = true } web-sys = { workspace = true, features = [ "WebSocket", "BinaryType", "MessageEvent", "CloseEvent", "ErrorEvent", ] } [target.'cfg(not(target_family = "wasm"))'.dependencies] rustls = { workspace = true } rustls-native-certs = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread"] } tokio-tungstenite = { workspace = true, features = ["rustls-tls-native-roots"] } rcgen = { workspace = true, optional = true } tokio-rustls = { workspace = true, optional = true } [dev-dependencies] bevy = { workspace = true } bevy_egui = { workspace = true } [[example]] name = "websocket_client" path = "examples/websocket_client.rs" required-features = ["client"] [[example]] name = "websocket_echo_server" path = "examples/websocket_echo_server.rs" required-features = ["server"]