How olib-ai/stealthrelay works
StealthRelay is a self-hosted encrypted-peer relay with a companion web client. Hosts claim a server, create invitations, and approve joining peers; clients then exchange opaque encrypted messages through WebSockets. The client adds chat, multiplayer games, and audio/video calls, while an optional tunnel gateway provides network exit access. The graph includes these documented product branches and the principal server/client layers; some subsystem links are documented in the README because their implementation was not sampled.
Main entry points: handler.rs Message Handler · websocket.ts Client WebSocket · main.rs Server Startup · App.tsx Client App
Components 24
Claim and Security
- Server Claim
crates/stealthos-server/src/claim.rs - Claim Setup
crates/stealthos-server/src/setup.rs - Host Identity
crates/stealthos-crypto/src/identity.rs - Invitations
crates/stealthos-crypto/src/invitation.rs - Proof of Work
crates/stealthos-crypto/src/pow.rs
Relay Runtime
- Server Startup
crates/stealthos-server/src/main.rs - Message Handler
crates/stealthos-server/src/handler.rs - Peer Pools
crates/stealthos-core/src/pool.rs - Frame Router
crates/stealthos-core/src/router.rs - Relay Frames
crates/stealthos-core/src/server_frame.rs - Tunnel Gateway
crates/stealthos-server/src/tunnel/mod.rs - Health and Metrics
crates/stealthos-observability/src/metrics.rs
WebSocket Transport
- WebSocket Listener
crates/stealthos-transport/src/listener.rs - Connection Actor
crates/stealthos-transport/src/connection.rs - Connection Registry
crates/stealthos-transport/src/connection_registry.rs
Client Connection
- Secure Handshake
crates/stealthos-crypto/src/handshake.rs - Client WebSocket
web-client/src/transport/websocket.ts - Client Protocol
web-client/src/protocol/messages.ts - Client App
web-client/src/App.tsx
Client Features
- Chat
web-client/src/views/ChatView.tsx - Multiplayer Games
web-client/src/views/games/Ludo.tsx - Audio Video Calls
web-client/src/calling/call-manager.ts
Other components
- Host Operator
- Peer Users
Connections 27
- Host Operator → Claim Setup: opens claim
README.md - Claim Setup → Server Claim: claims server
README.md - Host Operator → Invitations: creates invite
README.md - Peer Users → Client WebSocket: connects
README.md - Client WebSocket → WebSocket Listener: opens WebSocket
README.md - WebSocket Listener → Connection Actor: spawns actor
crates/stealthos-transport/src/listener.rs - WebSocket Listener → Connection Registry: registers connection
crates/stealthos-transport/src/listener.rs - Connection Actor → Connection Registry: routes events
crates/stealthos-transport/src/connection.rs - Server Startup → Message Handler: dispatches frames
crates/stealthos-server/src/main.rs - Message Handler → Peer Pools: manages pools
crates/stealthos-server/src/handler.rs - Message Handler → Connection Registry: sends frames
- Message Handler → Relay Frames: processes frames
crates/stealthos-server/src/handler.rs - Frame Router → Peer Pools: routes by pool
crates/stealthos-core/src/router.rs - Frame Router → Relay Frames: dispatches frames
crates/stealthos-core/src/router.rs - Message Handler → Invitations: validates invites
crates/stealthos-server/src/handler.rs - Host Identity → Secure Handshake: secures handshake
crates/stealthos-crypto/src/handshake.rs - Server Startup → Claim Setup: mounts setup
crates/stealthos-server/src/main.rs - Server Startup → Health and Metrics: serves health
README.md - Message Handler → Tunnel Gateway: dispatches tunnel
crates/stealthos-server/src/handler.rs - Client WebSocket → Client Protocol: uses protocol
web-client/src/views/ChatView.tsx - Client App → Chat: renders chat
web-client/src/App.tsx - Client App → Multiplayer Games: renders games
web-client/src/App.tsx - Client App → Audio Video Calls: renders calls
web-client/src/App.tsx - Chat → Client WebSocket: sends messages
web-client/src/views/ChatView.tsx - Multiplayer Games → Client WebSocket: sends game state
web-client/src/views/games/Ludo.tsx - Client WebSocket → Message Handler: relays encrypted data
README.md - Proof of Work → Message Handler: proves work