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-1.0.0.tar.gz
(13.4 kB
view details)
File details
Details for the file wsaio-1.0.0.tar.gz
.
File metadata
- Download URL: wsaio-1.0.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
f22c4dfec5a284faf40310c3462c8d3faffd65100b322a27a9b5e13738d894cd
|
|
MD5 |
4815188c8974561610a3f5a1e24ae7b1
|
|
BLAKE2b-256 |
c3fa3c89ffd50ee40ad6eba042b73603e0bde21c2dcb83c51b40d7b0ebe9b60a
|