• Stars
    star
    130
  • Rank 276,748 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A mutli-room chat application based on Tornado and Redis

Tornado-Redis-Chat

A mutli-room chat application based on Tornado and Redis

This is an example of a mutli-room chat application based on the asynchronous web framework Tornado. It uses Redis Pup/Sub feature as a message queue to distribute chat messages to multiple instances in a mutli-process setup. This way you can run this application in mutliple instances behind a load balancer like ninx. It uses brukva as asynchronous Redis client. Client-Server communication is based on websockets.

Note: Please note that this is just an example project for demonstration purpose only. It is little tested and missing important features like authenticated websockets, input validation and so on. It is intended to show how to build a scalable real-time web application with Tornado.

Example

You can try out a running demo of this application here: tornado-redis-chat.herokuapp.com

Requirements and Setup

First of all you need Redis:

sudo apt-get install redis-server

Next you need the following python packages:

sudo pip install tornado
sudo pip install git+https://github.com/evilkost/brukva.git

Finally clone this repository:

git clone https://github.com/nellessen/Tornado-Redis-Chat.git chat
cd chat

Run Application

You can run the application on a specific port like that:

python app.py --port=8888

Open localhost:8888 in your browser and see the result!