Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mminer/redis2ws

Rust WebSockets server that broadcasts Redis Pub/Sub messages
https://github.com/mminer/redis2ws

pubsub redis rust tungstenite websockets

Last synced: 3 days ago
JSON representation

Rust WebSockets server that broadcasts Redis Pub/Sub messages

Awesome Lists containing this project

README

        

# redis2ws (Redis to WebSockets)

This demonstrates a Rust WebSockets server that broadcasts Redis Pub/Sub
messages to connected clients. Glues together the
[redis](https://docs.rs/redis/latest/redis/) and
[tungstenite](https://docs.rs/tungstenite/latest/tungstenite/) crates.

## Usage

1. Start a Redis server
1. Run `cargo run foo`
1. Connect to ws://localhost:8080
([wscat](https://github.com/websockets/wscat) works well for testing)
1. Publish a message to the Redis `foo` channel

```
Usage: redis2ws [OPTIONS]

Arguments:
Redis PubSub channel

Options:
--redis Redis server address [default: localhost:6379]
--ws WebSocket server address [default: localhost:8080]
-h, --help Print help
-V, --version Print version
```