A minimal, secure, and extensible real-time messaging server written in Rust, designed as the foundation for a full-featured messenger with voice/video messages, file sharing, and WebRTC calls.
Built with performance, correctness, and modularity in mind — leveraging axum, tokio, and modern async Rust.
Status: ✅ MVP core complete — authentication, text messaging, and file uploads working.
- WebSocket-based real-time communication
- Authentication via token (JWT-ready)
- Peer-to-peer text messaging (online users only)
- File upload endpoint (
POST /upload) with unique URLs - Modular architecture (easy to extend)
- No external database required for MVP (state kept in memory)
Video/audio "circle" messages and WebRTC calls are not yet implemented (planned).
- Rust (1.70+)
cargo- (Optional)
websocatfor CLI testing
git clone https://github.com/zornfeuer/ironwire
cd ironwire
cargo runThe server will start on http://0.0.0.0:8080.
- Open two terminals.
- In each, connect via WebSocket:
websocat ws://localhost:8080/ws- In both, authenticate (use different tokens):
{"type":"auth","payload":{"token":"alice"}}
{"type":"auth","payload":{"token":"bob"}}You should receive:
{"type":"auth_ok"}- From
alice, send a message tobob:
{"type":"text","payload":{"to":"bob","text":"Hello from Alice!"}}bobwill receive:
{"type":"text","payload":{"from":"alice","text":"Hello from Alice!"}}Send POST request to http://localhost:8080/upload for example with curl:
curl -X POST --data-binary @yourfile.mp4 http://localhost:8080/uploadResponse:
{"url":"/media/abcd1234.bin"}Access it at: http://localhost:8080/media/abcd1234.bin
src/
├── main.rs # Entry point
├── messages.rs # Message types (ClientMessage, AppMessage)
├── state.rs # Shared in-memory state (online users)
├── ws.rs # Just forwarding ws submodules
├── http.rs # Just forwarding http submodules
├── ws/ # WebSocket session logic
│ ├── session.rs # Per-connection state & message handling
│ └── handler.rs # WebSocket upgrade handler
└── http/ # HTTP handlers (upload, fallback)
├── upload.rs
└── fallback.rs
| Feature | Status |
|---|---|
| Text messaging | ✅ Done |
| File uploads | ✅ Done |
| Audio/video "circle" msgs | ⏳ Planned |
| End-to-end encryption | ⏳ Planned |
| WebRTC voice/video calls | ⏳ Planned |
| Message history (SQLite) | ⏳ Planned |
| Offline message queue | ⏳ Planned |
| Group chats | ⏳ Planned |
The protocol is custom (not XMPP or Matrix), allowing full control over features and performance.
- All connections should be served over TLS in production (add
rustlssupport). - Authentication currently treats the token as the user ID (for MVP).
→ Will be replaced with JWT validation. - File uploads are stored on disk with random UUIDs (no execution allowed).
- Input validation and rate limiting will be added before production use.
- axum – Web framework
- tokio-tungstenite – WebSocket support
- serde – Serialization
- dashmap – Concurrent in-memory state
- tracing – Structured logging
MIT — see LICENSE for details.
💡 Contributions, suggestions, and security feedback are welcome!
This project is designed to be minimal, auditable, and privacy-respecting from the ground up.