Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

A websocket library for curio + trio

Project description


asyncwebsockets is a `curio`_ + `trio`_ compatible library for connecting and serving websockets.


To install the latest stable version::

$ pip install asyncwebsockets

To install the latest development version::

$ pip install git+

Basic Usage

.. code-block:: python3

import multio

from asyncwebsockets.client import connect_websocket
from import WebsocketConnectionEstablished, WebsocketBytesMessage

async def test():
sock = await connect_websocket("wss://", reconnecting=False)
async for message in sock:
print("Event received", message)
if isinstance(message, WebsocketConnectionEstablished):
await sock.send_message(b"test")

elif isinstance(message, WebsocketBytesMessage):
print("Got response:",
await sock.close(code=1000, reason="Thank you!")


.. _curio:
.. _trio:

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
asyncwebsockets-0.2.1-py3.6.egg (13.3 kB) Copy SHA256 hash SHA256 Egg 3.6 Feb 8, 2018
asyncwebsockets-0.2.1-py3-none-any.whl (7.7 kB) Copy SHA256 hash SHA256 Wheel py3 Feb 8, 2018
asyncwebsockets-0.2.1.tar.gz (9.3 kB) Copy SHA256 hash SHA256 Source None Feb 8, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page