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 3w 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://avatars.githubusercontent.com/u/23230491?v=4)[刘溟煜](/maintainers/tebie6)[@tebie6](https://github.com/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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M90](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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