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
Built Distributions
Close
Hashes for asyncwebsockets-0.1.dev2-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ca7635f0023699bbf486530e7781ee1847cd099dddb33b57c903a1802be9849 |
|
MD5 | b949f475f25f17959c9abf6c90ac5ac2 |
|
BLAKE2b-256 | fb6a213c20fc7c19b6fb30839ad510d8785dc649ceb34ee109eadb3e0ec6390b |
Close
Hashes for asyncwebsockets-0.1.dev2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9cdf6856fcb37aa3d372545e04c94b3983bf653c661cd12ef6ec233972f8838 |
|
MD5 | b1f55593ea9638c400c2ac9f8a90499c |
|
BLAKE2b-256 | 2883a79d2eea11dded615960d4bb287a315e63c301db75756a4af7c67cf674b0 |