Skip to main content

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))

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)

Uploaded Source

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

Hashes for wsaio-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f22c4dfec5a284faf40310c3462c8d3faffd65100b322a27a9b5e13738d894cd
MD5 4815188c8974561610a3f5a1e24ae7b1
BLAKE2b-256 c3fa3c89ffd50ee40ad6eba042b73603e0bde21c2dcb83c51b40d7b0ebe9b60a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page