Project description

What is trio-websockets?

trio-websockets is a library for building WebSocket servers and clients in
Python, based on trio, an asynchronous I/O framework.

Currently a work in progress. The status is:

The client-side works.

The server-side does not.

History of the library

The code is originally forked from aaugustin’s websockets library for asyncio,
with the following changes:

Rip out all asyncio things, replace with trio.

Rip out the websocket protocol code, replace with wsproto.

What remains of the original websockets library itself?

Most of the remaining code seems to be additional error checking around connection
state. Rather than a “trio.BrokenStreamError”, you will receive a ConnectionClosed
exception when trying to write on a closed connection.

The same/very similar interface to websockets, which might be slightly more
user-friendly than a raw wsproto connection (say, exposing attributes like .subprotocol,
which wsproto passes along during the ConnectionEstablished event).