A simple bridge to use Redis in a WebSocket way!
REDIS WebSocket Server is a simple NodeJS script used as a bridge to interact with Redis Server via WebSocket.
Running the environment with Docker:
docker-compose up
Check if Redis WebSocket Server responds at ws://127.0.0.1:8080 address.
Redis WebSocket Server uses only these dependencies:
- WebSocket: https://github.com/websockets/ws
- ioRedis: https://github.com/luin/ioredis
Send a command to Redis Server with Redis WebSocket Server
It will be necessary to send a WebSocket request with a payload like this:
{
command: 'SET foo 10',
sessionId: this.sessionId, // Client Side generated
date: Date.now()
}
The response will be an object like:
// Standard Response
{
response.command = 'SET foo 10';
response.output = 'OK';
response.status = 'ok';
}
// Response with error
{
response.command = 'unknown';
response.output = 'Invalid JSON';
response.status = 'error';
}
If you wish to contribute please read CONTRIBUTING.md file. Thanks for your future contributions!
Redis WebSocket Server is used, for instance, with Redis Patterns Project. It is used for communication between Redis Server and Redis Patterns Console.
With Redis Patterns Console you can try and go into the deep of Redis and its patterns with an interactive (and reactive) online console!
Visit https://acadevmy.github.io/redis-patterns-console and enjoy it!
Redis Patterns Console is an Angular SPA and an open-source project, so you can contribute if you wish.
Visit our repo on GitHub:
https://github.com/acadevmy/redis-patterns-console
Furthermore, you can visit REDIS Patterns Cookbook repository and read some of the most common patterns of Redis, the greatest in memory database.
Maintained with ❤️ by Acadevmy