skillfed

ws4py

WebSocket client and server library for Python 2 and 3 as well as PyPy

ws4py v0.6.0 434.5K downloads/30d#6,687 on PyPI1,127
Permissive license BSD Active released

What it is and what it does

ws4py is a Python library that implements the WebSocket protocol as defined in RFC 6455, allowing applications to establish persistent, bidirectional communication channels between clients and servers. It supports both client and server implementations and works across Python 2.7 and modern Python 3 versions as well as PyPy.

The library is designed for scenarios where you need real-time, low-latency communication—such as live notifications, collaborative editing, or streaming data—without the overhead of repeated HTTP requests. It can be used as WSGI middleware or as a standalone server component.

Use it for:

  • Building real-time chat or messaging applications where messages must flow instantly between connected clients
  • Streaming live data to multiple clients simultaneously without polling
  • Implementing collaborative tools that require bidirectional updates between browser and server
  • Creating WebSocket-based APIs for mobile or desktop clients that need persistent connections
  • Adding live notifications or alerts to web applications

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

ws4py implements the WebSocket protocol (RFC 6455) for Python, enabling bidirectional communication between clients and servers over a single TCP connection.

Yes, if you need WebSocket support in Python. The package is stable (Production/Stable status), has no known vulnerabilities, installs with zero dependencies, and is actively maintained. Suitable for production use.

Install

ws4py on PyPI

pip

pip install ws4py

uv

uv add ws4py

poetry

poetry add ws4py

Installing ws4py

Before you install

Installation is straightforward with no runtime dependencies. The package is actively maintained with a recent release (2024-12-19) and an active repository.

License in practice

BSD license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install ws4py

from ws4py.client.threadedclient import WebSocketClient

client = WebSocketClient('ws://example.com/echo')
client.connect()

Verify before relying

  • Whether the package actively supports Python 3.12 and PyPy despite the 603-day gap since last commit
  • Current state of CherryPy integration (listed in classifiers but integration details not in excerpt)

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 603 days since the last release
Last repo commit
First released
Downloads 434,528/month — #6,687 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ws4py-0.6.0-py3-none-any.whl

Development Status :: 5 - Production/StableFramework :: CherryPyIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: CommunicationsTopic :: Internet :: WWW/HTTP :: WSGI :: MiddlewareTopic :: Internet :: WWW/HTTP :: WSGI :: ServerTopic :: Software Development :: Libraries :: Python Modules

Tags

websocket protocol implementationwebsocket client server libraryRFC 6455 websocketbidirectional socket communicationreal-time web communicationwebsocket python librarypersistent connection protocol
websocketreal-time-communicationprotocol-implementation

More Python Modules packages