Skip to main content
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 <http://sockjs.org>`_ 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::

<script src="//cdnjs.cloudflare.com/ajax/libs/sockjs-client/1.1.4/sockjs.js"></script>
<script>
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');
};
</script>


Installation
------------
1. Install virtualenv::

$ wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py
$ python3.6 ./virtualenv.py --no-site-packages sockjs

3. Install sockjs-flask from pypi and then install::

$ pip install sockjs-flask
$ cd sockjs
$ ../sockjs/bin/python setup.py

To 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 <pycodi@hotmail.com>`_.

Metadata

Release files for sockjs-flask 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sockjs-flask 0.3
File Size Uploaded Provenance Actions
sockjs-flask-0.3.tar.gz 17.7 kB Without provenance Details for sockjs-flask-0.3.tar.gz

Release files / sockjs-flask-0.3.tar.gz

Download URL sockjs-flask-0.3.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9779772fe84a3b112a8d3b7465423e5973a39094d4970f6bdfca080682299f6d
BLAKE2b-256 checksum
How to use checksums
5f3b5cfea3db7e194b48023d03b18028b4cb9375864325d56b515a32847d1274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for sockjs-flask 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page