PHPackages                             tebie6/websocket - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. tebie6/websocket

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tebie6/websocket
================

基于swoole websocket 的聊天服务

12PHP

Since Jan 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/tebie6/websocket)[ Packagist](https://packagist.org/packages/tebie6/websocket)[ RSS](/packages/tebie6-websocket/feed)WikiDiscussions main Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

websocket test
==============

[](#websocket-test)

基于swoole websocket 的聊天服务 【仅限学习使用】

引用 composer require tebie6/websocket

```
具备以下特点
    1. 自定义二进制协议
    2. 支持单聊和群聊
    3. 基于用户名+密码的校验机制
    4. 支持消息确认机制
    5. 支持心跳检查，心跳包是服务器自动发送的，服务器在一定时间内未收到客户端的心跳回复，会断开客户端的连接
    8. 支持离线消息
交互特定
    1. 异步全双工
    2. 低延迟软实时

```

### 目录结构

[](#目录结构)

```
 ├── README.md
 ├── composer.json
 ├── composer.lock
 ├── doc                                      ## 文档
 │   └── socket.txt
 ├── src                                      ## 核心代码
 │   └── swoole
 │       ├── console
 │       │   └── SwooleService.php            ## 脚本继承类
 │       ├── logs                             ## 日志目录
 │       │   └── swoole.log
 │       ├── model                            ## model类
 │       │   ├── Chat.php
 │       │   ├── ConnectMysqli.php
 │       │   ├── OCurl.php
 │       │   └── OUtils.php
 │       ├── project                          ## 项目业务文件
 │       │   ├── ChatWebsocketServer.php
 │       │   └── chat.sql
 │       └── server                           ## 项目继承类
 │           └── WebsocketServer.php
 └── test                                     ## 测试样例
     ├── html                                 ## 样例前段代码
     │   ├── chat_client_websocket.html
     │   ├── chat_client_websocket2.html
     │   ├── jquery.json.js
     │   └── message.js
     └── websocket.php                        ## 入口文件

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/472e668f00e0e78dae2645469ebcd6c933d5d71ad310b367a19cb0b329034f8c?d=identicon)[tebie6](/maintainers/tebie6)

---

Top Contributors

[![tebie6](https://avatars.githubusercontent.com/u/23230491?v=4)](https://github.com/tebie6 "tebie6 (11 commits)")

### Embed Badge

![Health badge](/badges/tebie6-websocket/health.svg)

```
[![Health](https://phpackages.com/badges/tebie6-websocket/health.svg)](https://phpackages.com/packages/tebie6-websocket)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
