Skip to main content

A Chat Server based on sockjs, websocket and tornado

Project description

A sockJS based Chat-Server/Chat-System primary using the SockJS protocol.

Details

Author:

Anirban Roy Das

Email:

anirban.nick@gmail.com

Copyright(C):

2016, Anirban Roy Das <anirban.nick@gmail.com>

Check sockjsChat/LICENSE file for full Copyright notice.

Overview

sockjsChat is a very basic 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 particulartime and also Private Chat between those individual participants.

It uses the sockjs protocol to implement the real time message passing system. SockJS is implemented in many languages, primarily javascript to talk to servers in real time using its protocol, which tries to create a duplex bi-directional connectin between the Client(browser) and the Server. The 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.

You can read more about sockjs here

Technical Specs

sockjs-client:

Advance Websocket Javascript Client

Tornado:

async python web server

sockjs-tornado:

sockjs websocket server implementation for Tornado

Installation

Prerequisites

  1. python 2.7+

  2. tornado

  3. sockjs-tornado

  4. sockjs-client

Install

pip install sockjsChat

If the 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.

Step 2 - Install tornado

pip install tornado

Step 3 - Install sockjs-tornado

pip install sockjs-tornado

Usage

After having installed sockjsChat, just run the following command to use it :

  • Start Server

    $ sockjsChat [options]
  • Options

    –port:

    Port number where the chat server will start

  • Example

    $ sockjsChat --port=8765
  • Stop Server

    Click Ctrl+C to stop the server.

TODO

  1. Add Private Chat functionality.

  2. Manage Presence Management, sent, delivered acknowledgements.

  3. Message Persistence and delivery of messages to offline clients.

  4. Add Blog post regarding this topic.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sockjsChat-1.1.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

sockjsChat-1.1.0-py2-none-any.whl (28.5 kB view details)

Uploaded Python 2

File details

Details for the file sockjsChat-1.1.0.tar.gz.

File metadata

  • Download URL: sockjsChat-1.1.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sockjsChat-1.1.0.tar.gz
Algorithm Hash digest
SHA256 adaf649ad3ef6e83509e5abc584d8db7a559e3a89ae5d1aae7133bc3eee29c7e
MD5 c1473618366dda1178af9997673b7f62
BLAKE2b-256 00a998b82e23bf2a55a577ae888123a8754713f3ea61592cf20317af6d3437c2

See more details on using hashes here.

File details

Details for the file sockjsChat-1.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for sockjsChat-1.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 8778fe140f81528b661d268f5d78326e766cfa8ffaefed489711193a09bf1afb
MD5 643777ad2e9437c33e2cf066547b0be0
BLAKE2b-256 a3fa041aa0759a4887bf4d59143648eb715725c9a68137d708447d17599f3333

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page