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

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.7.5-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.5-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.5-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.5.tar.gz.

File metadata

  • Download URL: websocket_rs-0.7.5.tar.gz
  • Upload date:
  • Size: 195.6 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.5.tar.gz
Algorithm Hash digest
SHA256 38479e9f920bedde9b93f6453de4cb6b6d351145e0a78c5a29d60f8d35841703
MD5 b68af7aa5b76d8a6b000de543a26558c
BLAKE2b-256 d4875f92dc08628aefc3cd12a822aa8d9f53a95024eba07c1ddff8984c1eb69a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.5-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 943f37d4afc2866a1e98406a8a594b0693e53cf5a1a1b8461d8cee97a2745002
MD5 35388945e19857196272cdbaa8523040
BLAKE2b-256 2c02e6584e1696b0796d08153af8dbafd6de5cf279aac57c89c79b77fd2a0fac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.5-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 895fa08a6d24cfc81c456b2b9c841f3153a509398e0bbb1206238f0644e95439
MD5 dec06c6b90572f4c501e05c6bf96552e
BLAKE2b-256 435c8de3b9c685282ba929839788e82b28f8578301788b45861ef98df3f1ef32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.5-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 fd9f9d799eb73a8731af4c5778febd689b3090bdda822eeceff2c9eb4e0e5e18
MD5 484c6649c32039b0cacc4b5b1528b5d9
BLAKE2b-256 bb2723731a3e7e968db191d283f022e9d1eacb1e27771aae22ec73109afbcdfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.5-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45e5bdf691efd16334aaa07cfde28391d35ce3fd36dc95a33cee2393d9b16ead
MD5 0f88bc1022b4d9fffb3a4b8bc71e3b02
BLAKE2b-256 d50e2a9eb0be9ced1bd1e0284507ceaff5b417e7df93b50b01774a82711edc1b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.7

5 files

0.7.6

5 files

This release

0.7.5 This release

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