WebSocket-RS 🚀
High-performance WebSocket client implementation in Rust with Python bindings. Provides both sync and async APIs with significant performance improvements over pure Python implementations.
🎯 Performance Highlights
- Sync Client: 1.85x faster than websocket-client, 6.2x faster than websockets
- Async Client (Pipelined): 12x faster than picows, 21x faster than websockets
- Pure Rust implementation with zero-copy optimizations
- Thread-safe with concurrent operations support
📦 Installation
pip install websocket-rs
🚀 Quick Start
Synchronous Client
from websocket_rs.sync.client import connect
# Simple usage
with connect("ws://localhost:8765") as ws:
ws.send("Hello, WebSocket!")
response = ws.recv()
print(response)
Asynchronous Client
import asyncio
from websocket_rs.async_client import connect
async def main():
async with connect("ws://localhost:8765") as ws:
await ws.send("Hello, Async!")
response = await ws.recv()
print(response)
asyncio.run(main())
📚 Full Documentation
Visit our GitHub repository for comprehensive documentation:
- 📖 Full README: https://github.com/coseto6125/websocket-rs#readme
- 📊 Performance Benchmarks: https://github.com/coseto6125/websocket-rs/blob/main/docs/BENCHMARKS.md
- 🔧 API Reference: https://github.com/coseto6125/websocket-rs/blob/main/docs/API.md
- 🤝 Contributing Guide: https://github.com/coseto6125/websocket-rs/blob/main/docs/CONTRIBUTING.md
🌟 Key Features
- 🚄 High Performance: Rust-powered implementation
- 🔄 Dual APIs: Both sync and async support
- ✅ Drop-in Replacement: Compatible with Python websockets library
- 🔒 Thread-Safe: Safe concurrent operations
- ⚡ Zero-Copy: Optimized memory usage
- 🐍 Python 3.12+: Modern Python support
📝 Requirements
- Python 3.12 or higher
- Supported platforms: Linux, Windows, macOS (x86_64, ARM64)
🔗 Links
- Repository: https://github.com/coseto6125/websocket-rs
- Issues: https://github.com/coseto6125/websocket-rs/issues
- Changelog: https://github.com/coseto6125/websocket-rs/releases
📄 License
MIT License - see LICENSE for details.
Made with ❤️ using Rust and PyO3
Metadata
Release files for websocket-rs 0.7.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| websocket_rs-0.7.8.tar.gz | 207.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| websocket_rs-0.7.8-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details |
| websocket_rs-0.7.8-cp312-abi3-manylinux_2_34_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.34+ x86-64 | Details |
| websocket_rs-0.7.8-cp312-abi3-manylinux_2_34_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.34+ ARM64 | Details |
| websocket_rs-0.7.8-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 5.3 MB
Release files / websocket_rs-0.7.8.tar.gz
| Download URL | websocket_rs-0.7.8.tar.gz |
|---|---|
| Size | 207.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bac6b453091c01d00809608ce22d2c0b1871fd60f179fa0a1976798f5d4b732b
|
|
BLAKE2b-256 checksum How to use checksums |
4fc6e1ce6cb67258fa1776f631319dfeb84ec6765c6a92882f1412c0756e6681
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / websocket_rs-0.7.8-cp312-abi3-win_amd64.whl
| Download URL | websocket_rs-0.7.8-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c758e6b555edc52a11b6ab8410327c3699b08825340bbe3f5a45fa27eea981a3
|
|
BLAKE2b-256 checksum How to use checksums |
4c2e4fd6231f3c2fc5a0bdf32c9c02eeab8fefdfdab8fcf0f2df53de24d086b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / websocket_rs-0.7.8-cp312-abi3-manylinux_2_34_x86_64.whl
| Download URL | websocket_rs-0.7.8-cp312-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b1bec2a83fc419252904dea7b0170313820392f2ef7b264f1223eb6eda5b4e1f
|
|
BLAKE2b-256 checksum How to use checksums |
4834800ce7a2080e4e62cd62c30e4c82baa5874f59fabe092452b7aab2aec1ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / websocket_rs-0.7.8-cp312-abi3-manylinux_2_34_aarch64.whl
| Download URL | websocket_rs-0.7.8-cp312-abi3-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
2f6533c53c959a78f1d1180587e00a1b46a6713cb6a6c8dff509170ce4ac950d
|
|
BLAKE2b-256 checksum How to use checksums |
5f23b7e4b7d462126413773078b7bf931ede4e41acbcae18abc2b0fe003fe91b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / websocket_rs-0.7.8-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | websocket_rs-0.7.8-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9de1cc39741483d84e59a7f6031aa14f60f752bae264a49d20bd54fa959c7473
|
|
BLAKE2b-256 checksum How to use checksums |
2cc733ae0a979ee5146c4f20c76b15645d14595b125e84690051871d4eedfc86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|