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

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.7.3-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.3-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.3-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.3.tar.gz.

File metadata

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

File hashes

Hashes for websocket_rs-0.7.3.tar.gz
Algorithm Hash digest
SHA256 9b40de3ecec616907d2f0e8f51da08b62dfa4eac9a866486f46de4241331698b
MD5 5c83bb798fcf3ad4f310194eb95a8b0b
BLAKE2b-256 46cd9fa78f6505cbf58418ff6ea0d077ae80fc0c5a44ac3b3351a57cd5a4ed94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.3-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 92184e1d4d42f7233a63aa651b223e529a19040ad6ef69a812a3e602b1cce2ca
MD5 88fe61a1c5b6711dd10c4ba41c1118da
BLAKE2b-256 820324d15ec003ba2f6e0fd3c0f364faa05be0665e4c365f65695c3e321d3847

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.3-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1456580ecb8ad679acdffec2d070163f6dcca5c01f38f56ab35c56b799531406
MD5 584b80e0fd44b1c3ea24bd16a471ef18
BLAKE2b-256 17262b8fa53c5124adf6e6b4951d5c0f5806e3032b86d1da2cd3235472e595fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.3-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d14ee9d6458ca8fa8eaa914ce4a36a21690eb5b0cc2dada04c37f51d1c67c034
MD5 048b05c00b363346a27114943533a0b2
BLAKE2b-256 562612feec709086eb884167124d3c4a8159ffce2d1f99b3f0f89dd330e5e264

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bdd32febc499a5d5a364f8ebf263abb4213a3656244f5c5da982735febe5c17f
MD5 3f339ed99333ff40cc6eab8af58c6a17
BLAKE2b-256 bbca6100a1594c925af30fc3ecf7f3979568feea8b3aded49cefff0ac99534fa

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.7

5 files

0.7.6

5 files

0.7.5

5 files

0.7.4

5 files

This release

0.7.3 This release

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