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

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.7.2-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.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: websocket_rs-0.7.2.tar.gz
  • Upload date:
  • Size: 176.2 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.2.tar.gz
Algorithm Hash digest
SHA256 77c36ec85c2cf288ed0a402a041b65777ac54716b6a03dc8ed1ca1d9ca218d0e
MD5 3eb686e0743d40283dc3f35f94cef8fb
BLAKE2b-256 8c16c22c3475174ee41fa8e2cd849da3ea02def87d8997c6d14ab8302aead717

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.2-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4232b30f7dbdc0464a1f6a47dda56771ab827b6dd586439f6e4be74860623deb
MD5 0bcdb59d22586bb72457b084160f3342
BLAKE2b-256 95af3eefc580fe61fcbd4b1df799b227a2818ec5b14c918be0abfde8513f061d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.2-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7f83121949c49fea794dd7dab4a958cb90ae3f32bf89ad44257df1f5d5047c96
MD5 ff219812745abce502344910335217ac
BLAKE2b-256 db3ac32d96594d66a5d3b7d6bec52c448b6e7a60ef1187f5342ad02fb95e2781

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.2-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d4ce6e21058f52ed1e8faab2413357705e04c4b64ba080ce516e1dc2c278031a
MD5 f543daa69124d1bbb826dc5a4d450852
BLAKE2b-256 de9dc615fea51592c3ce848647a8b914fdc3b4cdd25ac9f1d576d524eb7cd45a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.2-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45eab6caf57664f8a5f31af12da30804787cfaf32321a5beefbd49baae6bb732
MD5 f7c2d2dd9414a3ea29ea458f731eb014
BLAKE2b-256 224091d9fd84c6f1198bc6b322d59a2d2b9fc8e6f8bc65a8b81124b54146792d

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

0.7.3

5 files

This release

0.7.2 This release

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