This repository contains a pure-Python implementation of a WebSocket protocol stack. It's written from the ground up to be embeddable in whatever program you choose to use, ensuring that you can communicate via WebSockets, as defined in RFC6455, regardless of your programming paradigm.
This repository does not provide a parsing layer, a network layer, or any rules about concurrency. Instead, it's a purely in-memory solution, defined in terms of data actions and WebSocket frames. RFC6455 and
Compression Extensions for WebSocket via RFC7692 are fully supported.
wsproto supports Python 2.7, 3.5 or higher.
To install it, just run:
$ pip install wsprotoIt passes the autobahn test suite completely and strictly in both client and server modes and using permessage-deflate.
If wsaccel is installed (optional), then it will be used to speed things up.
If you want to run the compliance tests, go into the compliance directory and then to test client mode, in one shell run the Autobahn test server:
$ wstest -m fuzzingserver -s ws-fuzzingserver.jsonAnd in another shell run the test client:
$ python test_client.pyAnd to test server mode, run the test server:
$ python test_server.pyAnd in another shell run the Autobahn test client:
$ wstest -m fuzzingclient -s ws-fuzzingclient.jsonDocumentation is available at https://wsproto.readthedocs.io/en/latest/.
wsproto welcomes contributions from anyone! Unlike many other projects we
are happy to accept cosmetic contributions and small contributions, in addition
to large feature requests and changes.
Before you contribute (either by opening an issue or filing a pull request), please read the contribution guidelines.
wsproto is made available under the MIT License. For more details, see the
LICENSE file in the repository.
wsproto was created by @jeamland, and is maintained by the python-hyper
community.