Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kriuchkov/sockjs-flask
sockjs server for Flask with gevent
https://github.com/kriuchkov/sockjs-flask
flask sockjs sockjs-server
Last synced: about 1 month ago
JSON representation
sockjs server for Flask with gevent
- Host: GitHub
- URL: https://github.com/kriuchkov/sockjs-flask
- Owner: kriuchkov
- License: mit
- Created: 2017-09-05T06:57:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T10:52:15.000Z (almost 7 years ago)
- Last Synced: 2024-12-14T01:38:35.358Z (about 1 month ago)
- Topics: flask, sockjs, sockjs-server
- Language: Python
- Homepage:
- Size: 55.7 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
SockJS server for Flask
============.. image:: https://img.shields.io/pypi/v/sockjs-flask.svg
:target: https://pypi.python.org/pypi/sockjs-flask
:alt: Latest PyPI version.. image:: https://travis-ci.org/borntyping/cookiecutter-pypackage-minimal.png
:target: https://travis-ci.org/borntyping/cookiecutter-pypackage-minimal
:alt: Latest Travis CI build status`sockjs` is a `SockJS `_ integration for Flask. SockJS interface
is implemented as a flask route. Its possible to create any number of different sockjs routes, ie `/sockjs/*` or `/mycustom-sockjs/*`.
You can provide different session implementation and management for each sockjs route.Usage
-----Client side code::
var sock = new SockJS('http://localhost:5000/sockjs');sock.onopen = function() {
console.log('open');
};sock.onmessage = function(obj) {
console.log(obj);
};sock.onclose = function() {
console.log('close');
};
Installation
------------
1. Install virtualenv::$ wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py
$ python3.6 ./virtualenv.py --no-site-packages sockjs3. Install sockjs-flask from pypi and then install::
$ pip install sockjs-flask
$ cd sockjs
$ ../sockjs/bin/python setup.pyTo run chat example use following command::
$ ./sockjs/bin/python ./sockjs-flask/examples/main.py
Requirements
^^^^^^^^^^^^- Python >= 3.4
- gunicorn
- gevent
- gevent-websocket
- kombu (for subscription)Authors
-------`sockjs-flask` was written by `Kryuchkov Nikita `_.