Distributed websocket chat
this is an experimental project that distribute websocket connections over a cluster.
This project is built on top of actix and actix-raft
In Config.toml
list your nodes under [[nodes]]
Every node has a private_addr
and a public_addr
private_addr
is the network address used for internal communication
and public_addr
is the network address exposed to the world.
cargo run CLUSTER_ADDRESS APP_ADDRESS PUBLIC_ADDRESS
Run in single node
cargo run 127.0.0.1:8000 127.0.0.1:9000 127.0.0.1:8080
Run cluster
cargo run 127.0.0.1:8000 127.0.0.1:9000 127.0.0.1:8080
cargo run 127.0.0.1:8001 127.0.0.1:9001 127.0.0.1:8081
cargo run 127.0.0.1:8002 127.0.0.1:9002 127.0.0.1:8082
Create room
/room/<Name>
TODO:
- Initiate cluster discovery
- Implement actix-raft
- Verify raft is working and replicating state across cluster
- Refactor hash_ring to Arc in order to reduce complexity
- Error handling
- Fix rejoin bug
- Rehash entities when hash ring topology changes
- Building js client