aiohttp server

WSRPC provides two-way remote procedure calls over WebSockets for aiohttp. Both peers can expose methods, make concurrent calls and receive results or remote exceptions over one connection.

Use functions for simple endpoints, route classes for state attached to a connection, and asynchronous signals to observe calls and connections. Python and JavaScript clients share the same RPC interface.

Python 3.10–3.15 is tested, including free-threaded 3.13–3.15. The base installation uses standard-library JSON and has no dependency on a native JSON extension.

Install

pip install wsrpc-aiohttp

The wheel includes the JavaScript client served through wsrpc_aiohttp.STATIC_DIR. For a separate frontend project:

npm install @wsrpc/client

Start with the shared quick start and choose your framework tab. The pages below cover transport-specific behavior and complete browser demos.

For ASGI applications, see the ASGI guide.

Source code and issue tracker: wsrpc/wsrpc-aiohttp. Created by Dmitry Orlov. The Python library is licensed under Apache-2.0; the bundled JavaScript client is licensed under MIT.