PHPackages                             fxj/swoole\_server - 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. fxj/swoole\_server

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

fxj/swoole\_server
==================

Swoole Websocket Server

1.0(7y ago)224MITPHPPHP &gt;=7.0

Since Aug 15Pushed 7y agoCompare

[ Source](https://github.com/king-fang/momo_swoole_server)[ Packagist](https://packagist.org/packages/fxj/swoole_server)[ RSS](/packages/fxj-swoole-server/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

momo\_swoole\_server
====================

[](#momo_swoole_server)

[Swoole](https://www.swoole.com)

websocket/http/tcp/upd
======================

[](#websockethttptcpupd)

1. websocket服务器也可以同时作为http服务器，设置了onRequest回调即可,默认开启
2. 自定义的回调类必须是继承*SwooleCallback*和实现对应的接口
3. 回调接口：*ISwooleUdpCallback*,*ISwooleWebsocketCallback*,*ISwooleCallback*
4. 当前服务器的*server*可以通过构造函数在回调的构造函数中获取\*\_\_construct($server)\* 获取,将其设置为成员属性即可

\#Start

```
/**
 * 初始化
 * TmSwoolerServer constructor.
 * @param string $host  IP/域名
 * @param int $port  端口
 * @param string $server_type 服务器类型tcp/udp/websocket
 * @param string $model 运行模式 process|base
 */
$client = new \Server\TmSwoolerServer('127.0.0.1',9502,'websocket');

//设置参数
$client->setOption(array(
    'reactor_num' => 2,
    'worker_num' => 4,
    'backlog' => 128,
    'max_request' => 50,
    'dispatch_mode' => 1,
));
//设置回调
$client->callback(\Server\Callback\SwooleWebsocketCallback::class);
//启动
$client->ServerStart();

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2829d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6550305d34c2106d39b676519993d8bed2beeb1df88353e8b05b8b041b93de44?d=identicon)[king-fang](/maintainers/king-fang)

---

Top Contributors

[![sublimesub](https://avatars.githubusercontent.com/u/18398740?v=4)](https://github.com/sublimesub "sublimesub (2 commits)")

### Embed Badge

![Health badge](/badges/fxj-swoole-server/health.svg)

```
[![Health](https://phpackages.com/badges/fxj-swoole-server/health.svg)](https://phpackages.com/packages/fxj-swoole-server)
```

###  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)
