fast_websocket_client
Tokio-native WebSocket client for Rust – high-throughput, low-latency, callback-driven, proxy-ready.
Supports two modes of operation:
- High-level callback-based client for ergonomic event-driven use.
- Low-level direct API for fine-tuned control with minimal dependencies.
Quick Example: examples/async_callback_client.rs
Features
- JavaScript-like callback API for event handling
- Async/await support via
tokio
- Powered by
fastwebsockets
- Built-in reconnection and ping loop
- TLS support
- Custom HTTP headers for handshake (e.g., Authorization)
- Proxy support (HTTP CONNECT & SOCKS5)
Installation
High-Level Callback API
An ergonomic, JavaScript-like API with built-in reconnect, ping, and lifecycle hooks.
// try this example with
// `cargo run --example wss_client`
use ;
use WebSocket;
async
Low-Level API
use ;
async
Running the Example
Clone the repo and run:
Migration Guide (from 0.2.0
)
Old | New |
---|---|
client::Offline |
base_client::Offline |
client::Online |
base_client::Online |
Runtime settings via Online 's methods |
Must now be set before connect via ConnectionInitOptions .Changes to the running WebSocket take effect on the next (re)connection. |
New users: We recommend starting with the WebSocket
API for best experience.
Documentation
💡 Actively maintained - contributions are welcome!