cdk_http_client/ws/mod.rs
1//! WebSocket client abstraction for CDK
2//!
3//! Provides a platform-agnostic WebSocket client. On native targets this uses
4//! `tokio-tungstenite`; on WASM it uses `ws_stream_wasm`.
5
6mod error;
7#[cfg(not(target_arch = "wasm32"))]
8mod native;
9#[cfg(target_arch = "wasm32")]
10mod wasm;
11
12pub use error::WsError;
13#[cfg(all(feature = "tor", not(target_arch = "wasm32")))]
14pub(crate) use native::connect_tor;
15#[cfg(not(target_arch = "wasm32"))]
16pub use native::{connect, from_websocket_stream, WsReceiver, WsSender};
17#[cfg(target_arch = "wasm32")]
18pub use wasm::{connect, WsReceiver, WsSender};