Skip to main content

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:

🌟 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

📄 License

MIT License - see LICENSE for details.


Made with ❤️ using Rust and PyO3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

websocket_rs-0.7.7.tar.gz (200.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

websocket_rs-0.7.7-cp312-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.7.7-cp312-abi3-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ x86-64

websocket_rs-0.7.7-cp312-abi3-manylinux_2_34_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ ARM64

websocket_rs-0.7.7-cp312-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file websocket_rs-0.7.7.tar.gz.

File metadata

  • Download URL: websocket_rs-0.7.7.tar.gz
  • Upload date:
  • Size: 200.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for websocket_rs-0.7.7.tar.gz
Algorithm Hash digest
SHA256 385c57b33d0704f4caea3c3e767197308034cf9a59f64ec64a4a26f959776359
MD5 66b68ffbca14746a949b967a70f15294
BLAKE2b-256 cfcd991db4b381cb4d2589940ff1ed19d5c6a55b952ba967e772dde3788e1e5c

See more details on using hashes here.

File details

Details for the file websocket_rs-0.7.7-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for websocket_rs-0.7.7-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ace6700a307da1a71fd92b2e0efdf4a1a21200bdff7d4294613b12863911c384
MD5 ab39688d2c91647edecf64e0950b16cb
BLAKE2b-256 ad862aa8dc607cbcdb12b0a994edab90be10978c5ea0ba3c76d3e1042e10197d

See more details on using hashes here.

File details

Details for the file websocket_rs-0.7.7-cp312-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for websocket_rs-0.7.7-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c3cdc791c57542400f5eb0b9c270a9a5e7a6f1c7e5640823dae1a7cf44e209f1
MD5 59139f564717d5b324680597a741ede5
BLAKE2b-256 76fc13abc7bde4cd35905487be4e1cfc1b3e219777389d8b53945dfd4e6dc6b0

See more details on using hashes here.

File details

Details for the file websocket_rs-0.7.7-cp312-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for websocket_rs-0.7.7-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 f9c0ccba2fbe29606b19d02fbf3da71f762d24687a3f36caf5d3a3e6091fc7a9
MD5 343031175c014ca7035559c6d3ada570
BLAKE2b-256 53ef6490c74b8410db661c9e118714fcbef30acba7258fe6b62cfdcc95ad68e7

See more details on using hashes here.

File details

Details for the file websocket_rs-0.7.7-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for websocket_rs-0.7.7-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a93d362a7bd0ab976b40a3c7a3f03aa679319db1b05add294b2cb2e05fc5e9b
MD5 93dcd6d4a930d76b6b8b264a3f1b0eae
BLAKE2b-256 93c6984f3285d3ebeab476c7b08591123122baf1ab470a02699d46498aed65b2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.7 This release

5 files

0.7.6

5 files

0.7.5

5 files

0.7.4

5 files

0.7.3

5 files

0.7.2

5 files

0.7.1

5 files

0.7.0

5 files

0.6.0

5 files

0.5.0

5 files

0.4.1

4 files

0.4.0

4 files

0.3.1

4 files

0.3.0

4 files

0.1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page