websockets-monoio-0.1.0 has been yanked.
websockets-monoio
Note: Documentation is AI generated.
A high-performance WebSocket client library built for the monoio async runtime using io_uring on Linux. This library provides both ws:// and wss:// (TLS) support with zero-copy operations and efficient memory usage.
Features
- 🚀 High Performance: Built on
monoioruntime withio_uringfor maximum efficiency on Linux - 🔒 TLS Support: Full
wss://support viamonoio-rustls - 📦 Zero Dependencies on tokio: Pure monoio implementation
- 🛡️ Secure: Uses
rustlswithwebpki-rootsfor certificate validation - ⚡ Zero-Copy: Efficient frame handling with minimal allocations
- 🔧 Simple API: Easy-to-use client interface
Quick Start
Add to your Cargo.toml:
[]
= "0.1.0"
= "0.2"
= "0.10"
= "1.0"
Examples
Basic WebSocket Connection
use ;
use WsClient;
async
Cryptocurrency Exchange Streaming
use ;
use WsClient;
async
Custom Headers
use WsClient;
async
API Reference
WsClient
The main client struct for WebSocket connections.
Methods
connect(url: &str, extra_headers: &[(&str, &str)]) -> Result<Self>- Connect to a WebSocket URLinto_inner(self) -> WebSocket<WsStream>- Get the underlying WebSocket stream
Supported URL Schemes
ws://- Plain WebSocket connectionswss://- TLS-encrypted WebSocket connections
Performance Characteristics
This library is optimized for high-frequency trading and real-time applications:
- Zero-copy frame handling where possible
- Efficient TLS via
rustlswith ring cryptography - io_uring integration for minimal syscall overhead on Linux
- Auto-pong/auto-close handling to reduce application overhead
Platform Support
- Linux: Full support with
io_uring - macOS/Windows: Limited support (falls back to standard async I/O)
For maximum performance, deploy on Linux with kernel version 5.1+ for full io_uring support.