2 releases
Uses new Rust 2024
| 0.1.1 | Mar 10, 2026 |
|---|---|
| 0.1.0 | Mar 10, 2026 |
#23 in Asynchronous
17KB
pushwire
Generic, multiplexed push protocol for real-time applications.
This is the umbrella crate that re-exports the pushwire sub-crates. Use this for convenience instead of depending on each sub-crate individually.
Installation
# Client only (default)
cargo add pushwire
# Server
cargo add pushwire -F server
# Both client and server
cargo add pushwire -F server,client
Sub-crates
| Crate | Description |
|---|---|
| pushwire-core | Shared types, binary codec, delta algorithm, fragment assembler |
| pushwire-server | Axum-based push server with WebSocket + SSE transports |
| pushwire-client | Async client with auto-reconnect, cursor tracking, channel dispatch |
Usage
use pushwire::{ChannelKind, Frame};
// Core types are always available
let frame: Frame<MyChannel> = Frame::new(MyChannel::Chat, serde_json::json!({"msg": "hi"}));
// Client (enabled by default)
use pushwire::pushwire_client::{ClientConfig, PushClient};
// Server (requires `server` feature)
use pushwire::pushwire_server::PushServer;
Feature flags
| Feature | Default | Description |
|---|---|---|
client |
yes | Re-exports pushwire-client |
server |
no | Re-exports pushwire-server |
Protocol highlights
- Generic channel system — define your own channels via
ChannelKindtrait - Cursor-based reliable delivery — resume after disconnect without message loss
- Priority queuing — high/normal/low priority lanes per channel
- Binary framing — MessagePack or CBOR encoding with zstd compression
- Fragment assembly — large payloads split and reassembled transparently
- Delta algorithm — SHA-256 gated incremental updates
- WebSocket + SSE transports — automatic fallback
- WebRTC signaling — optional peer-to-peer signaling relay
License
Apache-2.0
Dependencies
~7–14MB
~190K SLoC