[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8286":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":15,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},8286,"Ratchet","ratchetphp\u002FRatchet","ratchetphp","Asynchronous WebSocket server","http:\u002F\u002Fsocketo.me",null,"PHP",6433,792,216,8,0,6,4,39.7,"MIT License",false,"0.4.x",[24,25,26,27,28],"async","php","ratchet","websocket","websockets","2026-06-12 02:01:51","# Ratchet\n\n[![CI status](https:\u002F\u002Fgithub.com\u002Fratchetphp\u002FRatchet\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fratchetphp\u002FRatchet\u002Factions)\n[![Autobahn Testsuite](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAutobahn-passing-brightgreen.svg)](http:\u002F\u002Fsocketo.me\u002Freports\u002Fab\u002Findex.html)\n[![Latest Stable Version](https:\u002F\u002Fposer.pugx.org\u002Fcboden\u002Fratchet\u002Fv\u002Fstable.png)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fcboden\u002Fratchet)\n\nA PHP library for asynchronously serving WebSockets.\nBuild up your application through simple interfaces and re-use your application without changing any of its code just by combining different components.\n\n## Reviving Ratchet!\n\nWe're currently aiming to revive Ratchet to get it up to date with the latest versions and use this as a starting point for bigger updates to come.\nWe need your help to achieve this goal, see [ticket #1054](https:\u002F\u002Fgithub.com\u002Fratchetphp\u002FRatchet\u002Fissues\u002F1054) for ways to help out. ❤️\n\n## Requirements\n\nShell access is required and root access is recommended.\nTo avoid proxy\u002Ffirewall blockage it's recommended WebSockets are requested on port 80 or 443 (SSL), which requires root access.\nIn order to do this, along with your sync web stack, you can either use a reverse proxy or two separate machines.\nYou can find more details in the [server conf docs](http:\u002F\u002Fsocketo.me\u002Fdocs\u002Fdeploy#server_configuration).\n\n### Documentation\n\nUser and API documentation is available on Ratchet's website: http:\u002F\u002Fsocketo.me\n\nSee https:\u002F\u002Fgithub.com\u002Fcboden\u002FRatchet-examples for some out-of-the-box working demos using Ratchet.\n\nNeed help?  Have a question?  Want to provide feedback?  Write a message on the [Google Groups Mailing List](https:\u002F\u002Fgroups.google.com\u002Fforum\u002F#!forum\u002Fratchet-php).\n\n---\n\n### A quick example\n\n```php\n\u003C?php\nuse Ratchet\\MessageComponentInterface;\nuse Ratchet\\ConnectionInterface;\n\n    \u002F\u002F Make sure composer dependencies have been installed\n    require __DIR__ . '\u002Fvendor\u002Fautoload.php';\n\n\u002F**\n * chat.php\n * Send any incoming messages to all connected clients (except sender)\n *\u002F\nclass MyChat implements MessageComponentInterface {\n    protected $clients;\n\n    public function __construct() {\n        $this->clients = new \\SplObjectStorage;\n    }\n\n    public function onOpen(ConnectionInterface $conn) {\n        $this->clients->attach($conn);\n    }\n\n    public function onMessage(ConnectionInterface $from, $msg) {\n        foreach ($this->clients as $client) {\n            if ($from != $client) {\n                $client->send($msg);\n            }\n        }\n    }\n\n    public function onClose(ConnectionInterface $conn) {\n        $this->clients->detach($conn);\n    }\n\n    public function onError(ConnectionInterface $conn, \\Exception $e) {\n        $conn->close();\n    }\n}\n\n    \u002F\u002F Run the server application through the WebSocket protocol on port 8080\n    $app = new Ratchet\\App('localhost', 8080);\n    $app->route('\u002Fchat', new MyChat, array('*'));\n    $app->route('\u002Fecho', new Ratchet\\Server\\EchoServer, array('*'));\n    $app->run();\n```\n\n    $ php chat.php\n\n```javascript\n    \u002F\u002F Then some JavaScript in the browser:\n    var conn = new WebSocket('ws:\u002F\u002Flocalhost:8080\u002Fecho');\n    conn.onmessage = function(e) { console.log(e.data); };\n    conn.onopen = function(e) { conn.send('Hello Me!'); };\n```\n\n## Install\n\nThe recommended way to install this library is [through Composer](https:\u002F\u002Fgetcomposer.org\u002F).\n[New to Composer?](https:\u002F\u002Fgetcomposer.org\u002Fdoc\u002F00-intro.md)\n\nThis will install the latest supported version:\n\n```bash\ncomposer require cboden\u002Fratchet:^0.4.4\n```\n\nSee also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.\n\nThis project aims to run on any platform and thus does not require any PHP\nextensions and supports running on legacy PHP 5.4 through current PHP 8+.\nIt's *highly recommended to use the latest supported PHP version* for this project.\n\nSee above note about [Reviving Ratchet](#reviving-ratchet) for newer PHP support.\n\n## License\n\nMIT, see [LICENSE file](LICENSE).\n","Ratchet 是一个用于异步处理 WebSocket 通信的 PHP 库。它通过简单的接口构建应用，允许开发者在不改动现有代码的情况下，通过组合不同的组件来复用应用程序。Ratchet 的核心功能包括支持异步通信、易于集成和扩展，以及提供丰富的组件来快速搭建 WebSocket 服务器。该库特别适合需要实现实时双向通信的应用场景，如在线聊天室、实时数据更新服务等。要求用户具有 shell 访问权限，并推荐使用 root 权限以优化端口配置，确保 WebSocket 连接的顺畅。",2,"2026-06-11 03:17:09","top_language"]