Files
featherChat/warzone/crates/warzone-server/Cargo.toml
Siavash Sameni 2ca25fd2bf v0.0.5: WebSocket real-time messaging
Server:
- WS endpoint: /v1/ws/:fingerprint
- Connection registry in AppState (fingerprint → WS senders)
- On connect: flushes queued DB messages, then pushes in real-time
- send_message: pushes to WS if connected, falls back to DB queue
- Auto-cleanup on disconnect
- WS accepts both binary and JSON text frames for sending

Web client:
- Replaces 2-second HTTP polling with persistent WebSocket
- Auto-reconnects on disconnect (3-second backoff)
- Sends via WS when connected, HTTP fallback
- Messages arrive instantly (no polling delay)
- "Real-time connection established" shown on connect

HTTP polling still works:
- CLI recv command uses HTTP (unchanged)
- Web falls back to HTTP if WS fails
- Mules/scripts can still use HTTP API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 09:41:50 +04:00

28 lines
645 B
TOML

[package]
name = "warzone-server"
version.workspace = true
edition.workspace = true
[dependencies]
warzone-protocol = { path = "../warzone-protocol" }
tokio.workspace = true
axum.workspace = true
tower.workspace = true
tower-http.workspace = true
sled.workspace = true
serde.workspace = true
serde_json.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
thiserror.workspace = true
anyhow.workspace = true
uuid.workspace = true
chrono.workspace = true
hex.workspace = true
base64.workspace = true
rand.workspace = true
futures-util = "0.3"
ed25519-dalek.workspace = true
bincode.workspace = true