Files
featherChat/warzone/crates/warzone-client/Cargo.toml
Siavash Sameni fe2b7d8e8a TUI client: WebSocket with HTTP fallback
poll_loop now:
1. Tries WebSocket connection to /v1/ws/<fingerprint>
2. On success: receives messages in real-time (instant push)
3. On disconnect: reconnects after 3 seconds
4. On WS failure: falls back to HTTP polling every 2 seconds

Refactored message processing into shared functions:
- process_incoming() handles raw bytes
- process_wire_message() handles deserialized WireMessage
- Used by both WS and HTTP paths

Both CLI TUI and web client now use WebSocket:
- No more HTTP polling spam in server logs
- Messages arrive instantly on both clients
- HTTP poll kept as fallback for scripts/mules

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

33 lines
795 B
TOML

[package]
name = "warzone-client"
version.workspace = true
edition.workspace = true
[dependencies]
warzone-protocol = { path = "../warzone-protocol" }
tokio.workspace = true
reqwest.workspace = true
sled.workspace = true
clap.workspace = true
ratatui.workspace = true
crossterm.workspace = true
serde.workspace = true
serde_json.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
anyhow.workspace = true
argon2.workspace = true
chacha20poly1305.workspace = true
rand.workspace = true
zeroize.workspace = true
hex.workspace = true
base64.workspace = true
x25519-dalek.workspace = true
bincode.workspace = true
libc = "0.2"
uuid.workspace = true
chrono.workspace = true
tokio-tungstenite = { version = "0.24", features = ["native-tls"] }
futures-util = "0.3"
url = "2"