An event-driven WebSocket library for Python.
Project description
wsaio is a callback-based WebSocket library for Python.
Examples
import asyncio
from wsaio import WebSocketClient
class EchoClient(WebSocketClient):
async def on_text(self, data):
await self.write(data)
async def on_binary(self, data):
await self.write(data, binary=True)
async def main(loop):
client = EchoClient(loop=loop)
await client.connect('wss://localhost/helloWorld')
await client.wait_until_closed()
loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))
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
wsaio-0.1.2.tar.gz
(13.3 kB
view hashes)