This demonstrates a Rust WebSockets server that broadcasts Redis Pub/Sub messages to connected clients. Glues together the redis and tungstenite crates.
- Start a Redis server
- Run
cargo run foo
- Connect to ws://localhost:8080 (wscat works well for testing)
- Publish a message to the Redis
foo
channel
Usage: redis2ws [OPTIONS] <CHANNEL>
Arguments:
<CHANNEL> Redis PubSub channel
Options:
--redis <URL> Redis server address [default: localhost:6379]
--ws <URL> WebSocket server address [default: localhost:8080]
-h, --help Print help
-V, --version Print version