🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

asyncwebsockets

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asyncwebsockets

A websocket library

0.9.4
PyPI
Maintainers
2

asyncwebsockets

asyncwebsockets is an anyio-compatible websocket client library. Thus it works with curio, trio_, or asyncio.

Installation

To install the latest stable version::

$ pip install asyncwebsockets

To install the latest development version::

$ pip install git+https://github.com/Fuyukai/asyncwebsockets.git#egg=asyncwebsockets

Basic Usage

.. code-block:: python3

import anyio
import asyncwebsockets

async def test():
    async with asyncwebsockets.open_websocket("wss://echo.websocket.org") as ws:
        await ws.send("test")
        evt = await ws.next_event()
        print(type(evt), getattr(evt, 'data', None))


anyio.run(test)

.. _curio: https://curio.readthedocs.io/en/latest/ .. _trio: https://trio.readthedocs.io/en/latest/ .. _anyio: https://anyio.readthedocs.io/en/latest/

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts