wsproto: A pure Python WebSocket protocol stack — wsproto 1.2.0 documentation

# wsproto: A pure Python WebSocket protocol stack

wsproto is a WebSocket protocol stack written to be as flexible as possible. To that end it is written in pure Python and performs no I/O of its own. Instead it relies on the user to provide a bridge between it and whichever I/O mechanism is in use, allowing it to be used in single-threaded, multi-threaded or event-driven code.

The goal for wsproto is 100% compliance with RFC 6455. Additionally a mechanism is provided to add extensions allowing the implementation of extra functionally such as per-message compression as specified in RFC 7692.

For usage examples, see Getting Started or see the examples provided.

Contents:

- Installation
- Getting Started
  - Connections
  - WebSocket Clients
  - WebSocket Servers
  - Protocol Errors
  - Closing
  - Ping Pong
- Advanced Usage
  - Back-pressure
  - Post handshake connection
  - HTTP/2
- wsproto API
  - Semantic Versioning
  - Connection
  - Handshake
  - Events
  - Frame Protocol
  - Extensions
  - Exceptions