Registry / http-networking / wsaccel

wsaccel

JSON →
library0.6.7pypypi✓ verified 86d ago

wsaccel is a Python library that provides a WebSocket accelerator for `ws4py` and `AutobahnPython`. It replaces per-byte processing in these libraries with a faster Cython implementation, primarily for UTF-8 validation and payload masking. The project is currently at version 0.6.7, but its maintainer has indicated that it will cease active development due to its dependencies (ws4py and AutobahnPython) no longer being actively maintained. Users are advised to migrate to more actively supported WebSocket libraries like Tornado or websockets.

pip install wsaccel
INSTALL
IMPORT
SIG · WSACCEL
W
wsaccel
http-networkingpythonv0.6.7
Install
1.6s avg
Import
—
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.6.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.2MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

patch_autobahn
✓ from wsaccel import patch_autobahn
✗ import wsaccel
patch_ws4py
✓ from wsaccel import patch_ws4py
✗ import wsaccel

After installing `wsaccel`, it typically needs to be explicitly patched into `AutobahnPython` or `ws4py` to provide acceleration. For `websocket-client`, `wsaccel` is automatically used if present. The patching calls should be made before the target library processes WebSocket frames.

import wsaccel # To accelerate AutobahnPython: # import autobahn.websocket # wsaccel.patch_autobahn() # print('AutobahnPython patched by wsaccel.') # To accelerate ws4py: # import ws4py.server.cherrypyserver # wsaccel.patch_ws4py() # print('ws4py patched by wsaccel.') print('wsaccel imported. Manual patching for target libraries is required if not automatically detected.')
Debug
Known issues
deprecatedThe wsaccel project is explicitly marked by its maintainer as no longer actively maintained. Users are strongly advised to migrate to modern, actively maintained WebSocket libraries like Tornado or websockets.
fix
Plan to refactor your application to use a different WebSocket library (e.g., `websockets` or `Tornado`).
affects: 0.6.7 and prior
breakingBuilding `wsaccel` with Python 3.10 and newer may fail due to the removal of the deprecated Python buffer protocol API (e.g., `PyObject_AsReadBuffer()`). This can lead to `ImportError` or build failures.
fix
Consider using Python versions <= 3.9 if `wsaccel` is strictly necessary, or, preferably, migrate to an actively maintained WebSocket library that is compatible with newer Python versions.
affects: Python 3.10+
gotchaInstalling `wsaccel` alone does not provide any functionality. It acts as an accelerator for other WebSocket libraries. If those libraries are not installed or explicitly patched (for `ws4py`/`AutobahnPython`), `wsaccel` will have no effect.
fix
Ensure that `ws4py`, `AutobahnPython`, or `websocket-client` are installed alongside `wsaccel`, and for `ws4py`/`AutobahnPython`, apply the `patch_*()` calls as shown in the quickstart.
affects: All versions
Upgrade
Version history
0.6.7latest on PyPI · released Oct 10, 2024
Audit
Dependencies
ws4pyoptionalwsaccel accelerates UTF-8 validation and masking operations in ws4py, if ws4py is installed.
AutobahnPythonoptionalwsaccel accelerates UTF-8 validation and masking operations in AutobahnPython, if AutobahnPython is installed.
websocket-clientoptionalwsaccel provides a minor performance boost for UTF-8 validation and masking in websocket-client when available, without explicit patching.
Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
wsaccel — pip install wsaccel · libregistry