PHPackages                             flxxyz/swoole-websocket-and-tcp-and-udp - 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. flxxyz/swoole-websocket-and-tcp-and-udp

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

flxxyz/swoole-websocket-and-tcp-and-udp
=======================================

websocket+tcp+udp混用实例

v0.1(7y ago)251MITPHPPHP &gt;=5.6

Since Aug 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/flxxyz/swoole-websocket-and-tcp-and-udp)[ Packagist](https://packagist.org/packages/flxxyz/swoole-websocket-and-tcp-and-udp)[ RSS](/packages/flxxyz-swoole-websocket-and-tcp-and-udp/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

swoole websocket and tcp and udp
================================

[](#swoole-websocket-and-tcp-and-udp)

介绍
--

[](#介绍)

一个基于swoole的封装程序

实例
--

[](#实例)

```
$config = [
    'timezone'            => 'Asia/Shanghai',
    'tick_interval_timer' => 30, //秒
    'websocket'           => [
        'enable'  => true,
        'host'    => '0.0.0.0',
        'port'    => '9000',
        'type'    => SWOOLE_SOCK_TCP,
        'setting' => [
            'daemonize'       => false,
            'task_worker_num' => 1,
        ],
        'handler' => \swoole_websocket_and_tcp_and_udp_test\webscoket::class,
    ],
    'http'                => [
        'enable'  => true,
        'host'    => '0.0.0.0',
        'port'    => '9001',
        'type'    => SWOOLE_SOCK_TCP,
        'setting' => [],
        'handler' => \swoole_websocket_and_tcp_and_udp_test\http::class,
    ],
    'tcp'                 => [
        'enable'  => true,
        'host'    => '0.0.0.0',
        'port'    => '9002',
        'type'    => SWOOLE_SOCK_TCP,
        'setting' => [
            'open_eof_check'           => true,
            'package_eof'              => "\r\n",
            'dispatch_mode'            => 2,
            'heartbeat_check_interval' => 30,
            'heartbeat_idle_time'      => 60,
        ],
        'handler' => \swoole_websocket_and_tcp_and_udp_test\tcp::class,
    ],
    'udp'                 => [
        'enable'  => true,
        'host'    => '0.0.0.0',
        'port'    => '9003',
        'type'    => SWOOLE_SOCK_UDP,
        'setting' => [
            'open_eof_check' => true,
            'package_eof'    => "\r\n",
        ],
        'handler' => '',
    ],
];

$server = new \swoole_websocket_and_tcp_and_udp\Server($config);
$server->run();
```

任务
--

[](#任务)

- 监听websocket
- 监听http
- 监听tcp
- 监听udp
- 混合监听

感谢
--

[](#感谢)

[laravel-s](https://github.com/hhxsv5/laravel-s)项目给予很大的灵感，谢谢

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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

2828d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc4067bd7ab681ab6910584b3a38e2b113698f39dee9501ebe029ad9859de1af?d=identicon)[flxxyz](/maintainers/flxxyz)

---

Top Contributors

[![flxxyz](https://avatars.githubusercontent.com/u/8678079?v=4)](https://github.com/flxxyz "flxxyz (7 commits)")

---

Tags

swooleswoole-tcpswoole-udpswoole-websocket

### Embed Badge

![Health badge](/badges/flxxyz-swoole-websocket-and-tcp-and-udp/health.svg)

```
[![Health](https://phpackages.com/badges/flxxyz-swoole-websocket-and-tcp-and-udp/health.svg)](https://phpackages.com/packages/flxxyz-swoole-websocket-and-tcp-and-udp)
```

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