PHPackages                             go-swoole/base-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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. go-swoole/base-server

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

go-swoole/base-server
=====================

base-server

0.64(7y ago)212315MITPHP

Since Apr 25Pushed 7y ago4 watchersCompare

[ Source](https://github.com/go-swoole/base-server)[ Packagist](https://packagist.org/packages/go-swoole/base-server)[ RSS](/packages/go-swoole-base-server/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (6)Versions (67)Used By (0)

base-server
===========

[](#base-server)

基础服务

封装swoole，模块更科学更易用

```
class MyPort extends DefaultServerPort
{

}

class MyProcess extends DefaultProcess
{

}

enableRuntimeCoroutine();

//----多端口配置----
$httpPortConfig = new PortConfig();
$httpPortConfig->setHost("0.0.0.0");
$httpPortConfig->setPort(8080);
$httpPortConfig->setSockType(PortConfig::SWOOLE_SOCK_TCP);
$httpPortConfig->setOpenHttpProtocol(true);

$wsPortConfig = new PortConfig();
$wsPortConfig->setHost("0.0.0.0");
$wsPortConfig->setPort(8081);
$wsPortConfig->setSockType(PortConfig::SWOOLE_SOCK_TCP);
$wsPortConfig->setOpenHttpProtocol(true);

//---服务器配置---
$serverConfig = new ServerConfig();
$serverConfig->setWorkerNum(4);
$serverConfig->setLogFile(__DIR__ . "/../swoole.log");
$serverConfig->setPidFile(__DIR__ . "/../pid");

$server = new DefaultServer($serverConfig);

try {
    //添加端口
    $httpPort = $server->addPort($httpPortConfig, MyPort::class);//使用自定义实例
    $wsPort = $server->addPort($wsPortConfig);//使用默认实例
    //添加进程
    $test1Process = $server->addProcess("test1");
    $test2Process = $server->addProcess("test2", MyProcess::class);//使用自定义实例
    //配置
    $server->configure();
    //启动
    $server->start();
} catch (Exception $e) {
    var_dump($e->getTrace());
}

```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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

Every ~0 days

Total

65

Last Release

2595d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34264874?v=4)[SwooleDistributed](/maintainers/SwooleDistributed)[@SwooleDistributed](https://github.com/SwooleDistributed)

---

Top Contributors

[![kiss291323003](https://avatars.githubusercontent.com/u/24490609?v=4)](https://github.com/kiss291323003 "kiss291323003 (9 commits)")[![tmtbe](https://avatars.githubusercontent.com/u/5286367?v=4)](https://github.com/tmtbe "tmtbe (6 commits)")[![anythink-wx](https://avatars.githubusercontent.com/u/3948755?v=4)](https://github.com/anythink-wx "anythink-wx (3 commits)")

---

Tags

serverswoole

### Embed Badge

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

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[concrete5/core

Concrete – an open source content management system.

20163.8k49](/packages/concrete5-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)

PHPackages © 2026

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