A Chat-Server/Chat-System based on AMQP protocol(RabbitMQ Message Broker)
Documentation
Link : http://rabbitchat.readthedocs.io/en/latest/index.html
Details
- Author:
Anirban Roy Das
- Email:
- Copyright(C):
2016, Anirban Roy Das <anirban.nick@gmail.com>
Check rabbitChat/LICENSE file for full Copyright notice.
Overview
rabbitChat is a very simple Chat Server which can be set up locally to chat in your LAN. It supports both Public Chat among all participants connected simultaneously at a particular time and also Private Chat betweent those individual participants.
It uses the AMQP protocol to implement the real time message passing system. AMQP is implemented in many languages and in many softwares, once of such is RabbitMQ , which is a message broker implementing the AMQP protocol.
The connection is created using the sockjs protocol. SockJS is implemented in many languages, primarily in Javascript to talk to the servers in real time, which tries to create a duplex bi-directional connection between the Client(browser) and the Server. Ther server should also implement the sockjs protocol. Thus using the sockjs-tornado library which exposes the sockjs protocol in Tornado server.
It first tries to create a Websocket connection, and if it fails then it fallbacks to other transport mechanisms, such as Ajax, long polling, etc. After the connection is established, the tornado server**(sockjs-tornado)** connects to rabbitMQ via AMQP protocol using the AMQP Python Client Library, Pika.
Thus the connection is web-browser to tornado to rabbitMQ and vice versa.
Technical Specs
- sockjs-client:
Advanced Websocket Javascript Client
- Tornado:
Async Python Web Library + Web Server
- sockjs-tornado:
SockJS websocket server implementation for Tornado
- AMQP:
Advance Message Queuing Protocol used in Message Oriented Middleware
- pika:
AMQP Python Client Library
- RabbitMQ:
A Message Broker implementing AMQP
Features
Public chat
Shows who joined and who left
Shows number of people online
Shows who is typing and who is not
Join/Leave chat room features
Installation
Prerequisites
python 2.7+
tornado
sockjs-tornado
sockjs-client
pika
rabbitMQ
Install
$ pip install rabbitChat
If above dependencies do not get installed by the above command, then use the below steps to install them one by one.
Step 1 - Install pip
Follow the below methods for installing pip. One of them may help you to install pip in your system.
Method 1 - https://pip.pypa.io/en/stable/installing/
Method 3 - If you installed python on MAC OS X via brew install python, then pip is already installed along with python.
Step 2 - Install tornado
$ pip install tornadoStep 3 - Install sockjs-tornado
$ pip install sockjs-tornadoStep 4 - Install pika
$ pip install pikaStep 5 - Install RabbitMQ
For Mac Users
1. Brew Install RabbitMQ
$ brew install rabbitmqFor Ubuntu/Linux Users
1. Enable RabbitMQ application repository
$ echo "deb http://www.rabbitmq.com/debian/ testing main" >> /etc/apt/sources.list2. Add the verification key for the package
$ wget -o http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | sudo apt-key add -3. Update the sources with our new addition from above
$ apt-get update4. And finally, download and install RabbitMQ
$ sudo apt-get install rabbitmq-server
Usage
After having installed rabbitChat, just the run the following commands to use it:
RabbitMQ Server
1. For Mac Users
# start normally $ rabbitmq-server # If you want to run in background $ rabbitmq-server --detached # start using brew rervices (doesn't work with tmux) $ brew services rabbitmq start
2. For Ubuntu/LInux Users
# start normally $ rabbitmq-server # If you want to run in background $ rabbitmq-server --detached # To start using service $ service rabbitmq-server start # To stop using service $ service rabbitmq-server stop # To restart using service $ service rabbitmq-server restart # To check the status $ service rabbitmq-server status
Start rabbitChat Server
$ rabbitChat [options]
Options
- –port:
Port number where the chat server will start
Example
$ rabbitChat --port=9191
Stop rabbitChat Server
Click Ctrl+C to stop the server.
Todo
Add Private Chat functionality.
Manage Presence Management, sent, delivered acknowledgements.
Message Persistence and delivery of messages to offline clinets.
Add Blog post regarding this topic.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rabbitChat-1.0.0.tar.gz.
File metadata
- Download URL: rabbitChat-1.0.0.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47d969ff536f1fb752c7ec0e7edaf445452a7f75eed7f28cabecb6de540886ed
|
|
| MD5 |
999d920fb03d9d4b8c5e0ac80d47b626
|
|
| BLAKE2b-256 |
d2e114334ae23d1716227615ad68c85010236aaf5dfb2ac524cf1621a5c89d95
|
File details
Details for the file rabbitChat-1.0.0-py2-none-any.whl.
File metadata
- Download URL: rabbitChat-1.0.0-py2-none-any.whl
- Upload date:
- Size: 35.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c05cfe775f9998da2c332fb04d56b3c1d2805caabb5297c7606774c2b43d9da9
|
|
| MD5 |
ad015fefd877624e3ede6146af58834b
|
|
| BLAKE2b-256 |
2f62ba89bbfcc0006b4e605f12365b0ae3b7d4541e000cbb34b4b6dad0fffadc
|