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

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.7.4-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.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: websocket_rs-0.7.4.tar.gz
  • Upload date:
  • Size: 184.4 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.4.tar.gz
Algorithm Hash digest
SHA256 a4ca358b95fe421b5b42fbac13572116203c67f5609ef800411a80222e03dd3a
MD5 58373dd719b31cd436e35c233f00580c
BLAKE2b-256 a4ed2004fdf2d812f94b0698529da97011bfba39a62f3cc0276a10254df4f7a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.4-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 778fa5a7032c49fc9521d7241395d170b90cc46c71c901d639bb8731455a054e
MD5 f155d12b9d3df2052bf391e915697c6c
BLAKE2b-256 9adda03cebf6a37b13919b3258ad620f789a4776d861de29c4bf61e014b6e7d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.4-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ebd7a204657a78aac1018cd94385bf6511e4e5972a9f4fbafe430377a07e7018
MD5 e2852d47b5b5ce7e87374953a120aaef
BLAKE2b-256 3a7fa8402781d247b72c824a3cb565a9d8caadbffd91e8f91322c384c07c52e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.4-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 92158faef33e3f59ce027db82e35c6c6ac19ba5480b793c2b58ab6b1acaa06b5
MD5 19c75d50c6e59eb76a625cc4a8c245b1
BLAKE2b-256 34d394a4f10c36536d023405414e064b93dd4ed36f950b40ecb69c62afa7b1e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.4-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 933a94ddea649249b4ec8867db2a685aff3890676cb4332fd6ac4ca53f031e8a
MD5 76f18a262d1ea93f05ab03a141672dfe
BLAKE2b-256 c45bcbb67372c02a13df29fdc0ac99e6536933bd4cf05498221a985007aa439f

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

This release

0.7.4 This release

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