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.6.tar.gz (196.5 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.6-cp312-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.7.6-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.6-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.6-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.6.tar.gz.

File metadata

  • Download URL: websocket_rs-0.7.6.tar.gz
  • Upload date:
  • Size: 196.5 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.6.tar.gz
Algorithm Hash digest
SHA256 27de2eb3ec53ecb556d03d1dbccbd58a9225ceeffa41ab784e750f96fa420644
MD5 e1bb44dde7e653305e6bc752a97f132c
BLAKE2b-256 4b777fd0243ecc92e7c2672493615b645fa50f6998885fd000750524288857e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.6-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 52f4c6143438cdee29506aa6674fcbe3b8818404962eaba250960c52098f4f01
MD5 251e0485fb1f853f519e930434684437
BLAKE2b-256 2e8bd7b92c6b311f2d7b0c0ef20583371c4b0f2d6c325a8cc2714079dee35781

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.6-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c25791279c22df1d735db25c9891f69642adfef08f88e691702ce9f54e48b55c
MD5 8923bef6e083f1dbeb3617e82f372299
BLAKE2b-256 b4333fcf258333353755a3a51f7d0112bf67d8275dbcb2916811962e946dcbca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.6-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 533bc7697c75584a75190b395ea36bf9144f4b8eb872fa8babd176358f1d4c7d
MD5 8bed8cfb4d6cce8f3ade09ba4f55d742
BLAKE2b-256 96cde599ae2644511d337b19e32badb9defb1543cf17388d306478724d69e9a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.6-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5407f59ed96a36ce86b88cdd05033a64fa9467da0d56634e0c7abc2343a0f237
MD5 b245a88434fa1a6617b394e7e06d9f05
BLAKE2b-256 ade8cfa3f59420cb4eb9cb591a00a1c027ed07882a0d3fd566af73b23ceb0813

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.7

5 files

This release

0.7.6 This release

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