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.10
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.10.tar.gz | 203.3 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| websocket_rs-0.7.10-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details |
| websocket_rs-0.7.10-cp312-abi3-manylinux_2_34_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.34+ x86-64 | Details |
| websocket_rs-0.7.10-cp312-abi3-manylinux_2_34_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.34+ ARM64 | Details |
| websocket_rs-0.7.10-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.10.tar.gz
| Download URL | websocket_rs-0.7.10.tar.gz |
|---|---|
| Size | 203.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12d4d61edc85ead73fce4d88e1dc1e6e9113523d3f0852fa498c4a3026c482e2
|
|
BLAKE2b-256 checksum How to use checksums |
89bb6994600675ab594b86f83ff0cb1ed8c54bbc1e19793a24ead5a576596e69
|
| 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.10-cp312-abi3-win_amd64.whl
| Download URL | websocket_rs-0.7.10-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4c64ef1f7de3cb82a736e83c536fdaf97f2e7b11e589fedca89835d7a50da31f
|
|
BLAKE2b-256 checksum How to use checksums |
2523320f8aed23f857187ed726be0ee1ab2c5145919992842312966ddceee189
|
| 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.10-cp312-abi3-manylinux_2_34_x86_64.whl
| Download URL | websocket_rs-0.7.10-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 |
2a0cb721eccacd8eab8753bb08696d188c6862a1bc1ffc3ce1d54339cf8d7317
|
|
BLAKE2b-256 checksum How to use checksums |
833ba559645ac0cf89e02f0901b6459d91d873aaa5138d154dfe85051aca9498
|
| 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.10-cp312-abi3-manylinux_2_34_aarch64.whl
| Download URL | websocket_rs-0.7.10-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 |
ae79aaf3d1327900bcc4cb766ce4bdf1c5b2a7a25d8b7a3aff0d2eea204cc147
|
|
BLAKE2b-256 checksum How to use checksums |
1b2126fa43af19a22e1958c32c55cd54df3e9205f6de41e8845ed4e75420ec4f
|
| 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.10-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | websocket_rs-0.7.10-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 |
39a99665d09574e7f751f6e26486d78321d6736700aa8c724c7b4bad627696e6
|
|
BLAKE2b-256 checksum How to use checksums |
a601ac1734ddbc4b3df8af1d45e1343ab079c74509ddfefe6082a54a0616ed1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|