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.tar.gz
(5.5 kB
view hashes)
Built Distributions
asyncwebsockets-0.1-py3.6.egg
(8.5 kB
view hashes)
Close
Hashes for asyncwebsockets-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efc1170d4a0b7a61f53288750c9a352cc66f12c9679a1130d5b06b6ae7b3620f |
|
MD5 | dc40f0191b5d3ec22998535f2732197f |
|
BLAKE2b-256 | 8190b30a0c88fc2045c528c2d0d601e2abd0a17523539262947ac07807f54496 |