Skip to main content

WebSocket client with Rust backend

Project description

RWS Client (Rust WebSocket Client)

一个高性能的 WebSocket 客户端库,使用 Rust 实现核心功能,通过 PyO3 提供 Python 接口。

特性

  • 高性能:核心使用 Rust 实现
  • 异步支持:完全支持 Python asyncio
  • 多连接:支持同时管理多个 WebSocket 连接
  • 事件驱动:支持 on_message、on_open、on_close 回调

安装

前置要求

  1. Python 3.11 或更高版本
  2. Rust 工具链
    # 安装 Rust
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
    # 重新加载环境变量
    source "$HOME/.cargo/env"
    
    # 验证安装
    cargo --version
    rustc --version
    

从 PyPI 安装

pip install rws-client
# 或者使用 poetry
poetry add rws-client

故障排除

如果遇到 "Cargo metadata failed" 错误,请检查:

  1. Rust 是否正确安装:

    cargo --version
    
  2. 环境变量是否正确设置:

    echo $PATH | grep cargo
    
  3. 如果没有找到 cargo,手动添加到 PATH:

    export PATH="$HOME/.cargo/bin:$PATH"
    
  4. 确保系统有必要的编译工具:

    Ubuntu/Debian:

    sudo apt-get update
    sudo apt-get install build-essential pkg-config libssl-dev
    

    CentOS/RHEL:

    sudo yum groupinstall "Development Tools"
    sudo yum install openssl-devel
    

使用示例

...(其余内容保持不变)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rws_client-0.1.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rws_client-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

File details

Details for the file rws_client-0.1.0.tar.gz.

File metadata

  • Download URL: rws_client-0.1.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.5 Linux/5.15.0-60-generic

File hashes

Hashes for rws_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cd41e275d3f9bce3f18333398759f843e2df3fc24e7490846def5977b73e6e9e
MD5 70e1ab517db94e95b404a3beeb9fc0c0
BLAKE2b-256 ea2c2efef8dd6d6b5aba5a7def9da181cc652033735c394a7c898001e4118d72

See more details on using hashes here.

File details

Details for the file rws_client-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rws_client-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 109a4d45bd7c680a4900705e2e2ce72239845b4cf15217bd10963c1f04763b9b
MD5 05a25a2a27b014c75e8ae7290343228c
BLAKE2b-256 c6996fc24d6850c1a8107da7037024c1b2d67314c4edd7ff4170b82bfb732082

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page