{"id":15033590,"url":"https://github.com/ratchetphp/ratchet","last_synced_at":"2026-01-12T01:06:43.434Z","repository":{"id":3026381,"uuid":"4046328","full_name":"ratchetphp/Ratchet","owner":"ratchetphp","description":"Asynchronous WebSocket server","archived":false,"fork":false,"pushed_at":"2024-08-09T05:07:07.000Z","size":1274,"stargazers_count":6334,"open_issues_count":215,"forks_count":784,"subscribers_count":222,"default_branch":"master","last_synced_at":"2025-04-22T20:04:50.599Z","etag":null,"topics":["async","php","ratchet","websocket","websockets"],"latest_commit_sha":null,"homepage":"http://socketo.me","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ratchetphp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-04-16T21:53:21.000Z","updated_at":"2025-04-20T23:15:25.000Z","dependencies_parsed_at":"2023-07-05T19:48:08.998Z","dependency_job_id":"e3690646-431a-4af1-b4e9-4f365075d729","html_url":"https://github.com/ratchetphp/Ratchet","commit_stats":{"total_commits":640,"total_committers":55,"mean_commits":"11.636363636363637","dds":"0.19374999999999998","last_synced_commit":"5012dc954541b40c5599d286fd40653f5716a38f"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratchetphp%2FRatchet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratchetphp%2FRatchet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratchetphp%2FRatchet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratchetphp%2FRatchet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ratchetphp","download_url":"https://codeload.github.com/ratchetphp/Ratchet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252882200,"owners_count":21819148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","php","ratchet","websocket","websockets"],"created_at":"2024-09-24T20:21:51.900Z","updated_at":"2025-05-07T12:47:02.549Z","avatar_url":"https://github.com/ratchetphp.png","language":"PHP","readme":"# Ratchet\n\n[![GitHub Actions][GA Image]][GA Link]\n[![Autobahn Testsuite](https://img.shields.io/badge/Autobahn-passing-brightgreen.svg)](http://socketo.me/reports/ab/index.html)\n[![Latest Stable Version](https://poser.pugx.org/cboden/ratchet/v/stable.png)](https://packagist.org/packages/cboden/ratchet)\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://github.com/ratchetphp/Ratchet/issues/1054) for ways to help out. ❤️\n\n## Requirements\n\nShell access is required and root access is recommended.\nTo avoid proxy/firewall 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://socketo.me/docs/deploy#server_configuration).\n\n### Documentation\n\nUser and API documentation is available on Ratchet's website: http://socketo.me\n\nSee https://github.com/cboden/Ratchet-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://groups.google.com/forum/#!forum/ratchet-php).\n\n---\n\n### A quick example\n\n```php\n\u003c?php\nuse Ratchet\\MessageComponentInterface;\nuse Ratchet\\ConnectionInterface;\n\n    // Make sure composer dependencies have been installed\n    require __DIR__ . '/vendor/autoload.php';\n\n/**\n * chat.php\n * Send any incoming messages to all connected clients (except sender)\n */\nclass MyChat implements MessageComponentInterface {\n    protected $clients;\n\n    public function __construct() {\n        $this-\u003eclients = new \\SplObjectStorage;\n    }\n\n    public function onOpen(ConnectionInterface $conn) {\n        $this-\u003eclients-\u003eattach($conn);\n    }\n\n    public function onMessage(ConnectionInterface $from, $msg) {\n        foreach ($this-\u003eclients as $client) {\n            if ($from != $client) {\n                $client-\u003esend($msg);\n            }\n        }\n    }\n\n    public function onClose(ConnectionInterface $conn) {\n        $this-\u003eclients-\u003edetach($conn);\n    }\n\n    public function onError(ConnectionInterface $conn, \\Exception $e) {\n        $conn-\u003eclose();\n    }\n}\n\n    // Run the server application through the WebSocket protocol on port 8080\n    $app = new Ratchet\\App('localhost', 8080);\n    $app-\u003eroute('/chat', new MyChat, array('*'));\n    $app-\u003eroute('/echo', new Ratchet\\Server\\EchoServer, array('*'));\n    $app-\u003erun();\n```\n\n    $ php chat.php\n\n```javascript\n    // Then some JavaScript in the browser:\n    var conn = new WebSocket('ws://localhost:8080/echo');\n    conn.onmessage = function(e) { console.log(e.data); };\n    conn.onopen = function(e) { conn.send('Hello Me!'); };\n```\n\n[GA Image]: https://github.com/ratchetphp/Ratchet/workflows/CI/badge.svg\n\n[GA Link]: https://github.com/ratchetphp/Ratchet/actions?query=workflow%3A%22CI%22+branch%3Amaster\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratchetphp%2Fratchet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratchetphp%2Fratchet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratchetphp%2Fratchet/lists"}