wsproto
Pure-Python WebSocket protocol implementation
Decision gist · record as of 2026-08-14
Yes. wsproto is a mature, actively maintained library (Production/Stable, recent commits) with no known vulnerabilities, low install friction, and permissive MIT licensing. Install it if you need WebSocket protocol handling in a custom or existing application where you control the network layer. Skip it if you want an all-in-one WebSocket server framework with built-in networking and concurrency—use it as a component within such a framework instead.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or higher; you must provide your own network socket and concurrency handling.
- Low friction: single runtime dependency (h11), pure-Python wheel distribution, and actively maintained with recent commits.
- Supports modern Python versions (3.10+) and marked Production/Stable.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
last release 2025-11-20 (267 days) · last repo commit 2026-05-23 · 303 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 89,034,220 downloads/mo, #380 on PyPI
Alternatives
Verify before relying
pip install wsproto
from wsproto import WSConnection, ConnectionType
from wsproto.events import Request
ws = WSConnection(ConnectionType.CLIENT)
ws.send(Request(host='echo.websocket.org', target='/'))
data_to_send = ws.bytes_to_send()- Whether compression extensions (RFC7692) are fully tested and production-ready in current version
- Performance characteristics and throughput limits compared to alternative WebSocket implementations
What it is and what it does
wsproto is a state-machine-based WebSocket protocol library written in pure Python. It handles the RFC6455 WebSocket protocol and compression extensions (RFC7692) as an in-memory, embeddable component—you provide the network socket and concurrency model, and wsproto manages frame parsing, protocol state, and message serialization. It generates events (like TextMessage, BytesMessage, CloseConnection) when data arrives and produces bytes to send back over your network layer.
The library is designed for flexibility: it works equally well in synchronous code, async frameworks, or custom event loops because it has no opinions about I/O or threading. You feed it incoming bytes via receive_data(), poll for events(), send outgoing data via send(), and call bytes_to_send() to get the bytes to push over the wire. This separation of concerns makes it suitable for embedding in HTTP servers, proxies, or any application that needs WebSocket support without being locked into a specific networking model.
Use it for
- Build a WebSocket server endpoint in an existing HTTP framework by handling protocol state and frame parsing independently.
- Implement a WebSocket client that connects to remote servers while managing your own socket and retry logic.
- Add WebSocket support to a custom event loop or async runtime without adopting a full framework.
- Create a WebSocket proxy or gateway that needs to inspect and forward frames without reimplementing the protocol.
- Test WebSocket applications by simulating client and server connections in unit tests.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
wsproto is a mature, actively maintained library (Production/Stable, recent commits) with no known vulnerabilities, low install friction, and permissive MIT licensing. Install it if you need WebSocket protocol handling in a custom or existing application where you control the network layer. Skip it if you want an all-in-one WebSocket server framework with built-in networking and concurrency—use it as a component within such a framework instead.
Install
wsproto on PyPI
Before you install
Low friction: single runtime dependency (h11), pure-Python wheel distribution, and actively maintained with recent commits. Supports modern Python versions (3.10+) and marked Production/Stable.
Requires Python 3.10 or higher; you must provide your own network socket and concurrency handling.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
pip install wsproto
from wsproto import WSConnection, ConnectionType
from wsproto.events import Request
ws = WSConnection(ConnectionType.CLIENT)
ws.send(Request(host='echo.websocket.org', target='/'))
data_to_send = ws.bytes_to_send()
Verify before relying
- Whether compression extensions (RFC7692) are fully tested and production-ready in current version
- Performance characteristics and throughput limits compared to alternative WebSocket implementations
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageh11 |
| Maintenance | Actively maintained 267 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 89,034,220 / month, #380 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: wsproto-1.3.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pure python websocket”
- wsprotowsproto is a pure-Python WebSocket protocol implementation that…
- websocketswebsockets is a library for building WebSocket servers and clients in…
- websocket-clientwebsocket-client provides a Python WebSocket client implementing the…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also trio-websocket · ws4py · autobahn · h2 · websocket-client · websockets · hyperframe · jh2 · gevent-websocket