https://github.com/betacatpro/websocket-pro-client
High-performance WebSocket client with auto-reconnect, heartbeat and priority messaging
https://github.com/betacatpro/websocket-pro-client
Last synced: 10 months ago
JSON representation
High-performance WebSocket client with auto-reconnect, heartbeat and priority messaging
- Host: GitHub
- URL: https://github.com/betacatpro/websocket-pro-client
- Owner: BetaCatPro
- License: mit
- Created: 2025-08-09T11:54:04.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-08-09T13:40:10.000Z (10 months ago)
- Last Synced: 2025-08-09T14:13:43.139Z (10 months ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WebSocket Pro Client
[](https://www.npmjs.com/package/websocket-pro-client)
[](https://github.com/BetaCatPro/websocket-pro-client/actions)
高性能 WebSocket 客户端,专为现代 Web 应用设计。
## 特性
- 🚀 自动重连 + 智能退避算法
- 💓 可配置心跳检测
- 🎯 消息优先级调度
- 📦 多连接池管理
- 🔍 完整的 TypeScript 支持
## 安装
```bash
npm install websocket-pro-client
# 或
yarn add websocket-pro-client
```
## 快速开始
```typescript
import { createWebSocketManager } from "websocket-pro-client";
const manager = createWebSocketManager({
maxReconnectAttempts: 5,
});
const client = manager.connect("wss://api.example.com");
client.on("message", (data) => {
console.log("Received:", data);
});
client.send({ action: "subscribe" });
```
## 开发调试
```bash
# 启动测试
npm test
# 构建库
npm run build
# 运行demo
npm run demo
```
## 贡献指南
1. Fork 仓库
2. 创建分支 (`git checkout -b dev/feature/fix-xxx`)
3. 提交更改 (`git commit -am 'feat/fix xxx'`)
4. 推送到分支 (`git push origin dev/feature/fix-xxx`)
5. 创建 Pull Request
## 后续工作
1. 自定义心跳包
2. 添加更多配置项
3. 添加完整测试用例(单元测试/集成测试)
4. 完善说明 API 文档
## 许可证
MIT © 2023 BetaCatPro