pushwire-server
Generic, multiplexed push server for real-time applications. Built on Axum with WebSocket and SSE transports.
Part of the pushwire protocol family.
Features
PushServer<C>— generic over yourChannelKind, register per-channel handlers- WebSocket + SSE — dual transport with
/rps(WebSocket),/rps/sse(SSE),/rps/ack(HTTP POST) - Cursor-based replay — clients resume after disconnect without message loss
- Priority queuing — high/normal/low lanes based on
ChannelKind::priority() - Auth validation — pluggable
AuthValidatorcallback on handshake - Binary assets — inline (base64) or pointer delivery with SHA-256 integrity
- Transport manager — Direct/P2P/Relay routing with automatic failover and backoff
- Relay controller — bandwidth-limited server-side relay with token-bucket rate limiting
- WebRTC signaling — optional peer-to-peer signaling relay (
rtcfeature)
Quick start
use PushServer;
use Arc;
// Define MyChannel implementing ChannelKind (see pushwire-core)
let server: = new;
server.register_handler;
let app = server.clone.router;
let listener = bind.await.unwrap;
serve.await.unwrap;
Endpoints
| Route | Method | Description |
|---|---|---|
/rps |
GET (WebSocket upgrade) | Primary push channel — auth handshake, bidirectional frames |
/rps/sse |
GET | Server-Sent Events stream — ?client_id=...&channels=chat,system |
/rps/ack |
POST | HTTP acknowledgment — { client_id, channel, cursor } |
Feature flags
rtc(default) — enables WebRTC signaling relay viapushwire-core/rtc
License
Apache-2.0