A websocket library for curio + trio
Project description
asyncwebsockets
=======
asyncwebsockets is a `curio`_ + `trio`_ compatible library for connecting and serving websockets.
Installation
------------
To install the latest stable version::
$ pip install asyncwebsockets
To install the latest development version::
$ pip install git+https://github.com/SunDwarf/asyncwebsockets.git#egg=asyncwebsockets
Basic Usage
-----------
.. code-block:: python
import multio
from asyncwebsockets import open_websocket, Websocket
async def main():
sock: Websocket = await connect_websocket("wss://echo.websocket.org")
await sock.send_message("Hello, world!")
ev = await sock.next_message()
print(ev.data) # "Hello, world!"
await sock.close(code=1000, reason="Goodbye")
multio.init("curio")
multio.run(main)
.. _curio: https://curio.readthedocs.io/en/latest/
.. _trio: https://trio.readthedocs.io/en/latest/
=======
asyncwebsockets is a `curio`_ + `trio`_ compatible library for connecting and serving websockets.
Installation
------------
To install the latest stable version::
$ pip install asyncwebsockets
To install the latest development version::
$ pip install git+https://github.com/SunDwarf/asyncwebsockets.git#egg=asyncwebsockets
Basic Usage
-----------
.. code-block:: python
import multio
from asyncwebsockets import open_websocket, Websocket
async def main():
sock: Websocket = await connect_websocket("wss://echo.websocket.org")
await sock.send_message("Hello, world!")
ev = await sock.next_message()
print(ev.data) # "Hello, world!"
await sock.close(code=1000, reason="Goodbye")
multio.init("curio")
multio.run(main)
.. _curio: https://curio.readthedocs.io/en/latest/
.. _trio: https://trio.readthedocs.io/en/latest/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asyncwebsockets-0.1.1.tar.gz
(5.6 kB
view hashes)
Built Distributions
Close
Hashes for asyncwebsockets-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aebe53769feedee0167687f4b9d19c17bd8010e1a9f51d3813d15d223063fa5a |
|
MD5 | 0977cb9f50fbbbb85a96460e745f2bd1 |
|
BLAKE2b-256 | 35be158f0e813203a66d71184825b7f492853dc567f03a09a22f5a8ed479a9f9 |