{"id":13700044,"url":"https://github.com/utopia-php/websocket","last_synced_at":"2025-04-14T08:38:07.492Z","repository":{"id":45336431,"uuid":"378880657","full_name":"utopia-php/websocket","owner":"utopia-php","description":"Lite \u0026 fast micro PHP WebSocket server abstraction that is **easy to use**.","archived":false,"fork":false,"pushed_at":"2025-03-28T01:12:04.000Z","size":178,"stargazers_count":12,"open_issues_count":0,"forks_count":12,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-14T00:57:21.230Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","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/utopia-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-21T09:42:43.000Z","updated_at":"2025-04-04T19:13:11.000Z","dependencies_parsed_at":"2024-04-09T05:29:48.911Z","dependency_job_id":"30b0a432-290b-4a8a-8e6d-e682f5594080","html_url":"https://github.com/utopia-php/websocket","commit_stats":{"total_commits":53,"total_committers":7,"mean_commits":7.571428571428571,"dds":"0.39622641509433965","last_synced_commit":"f0a59bf26437bf88883c51d227cd683d929abd2e"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fwebsocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fwebsocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fwebsocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fwebsocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utopia-php","download_url":"https://codeload.github.com/utopia-php/websocket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804787,"owners_count":21164132,"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":["hacktoberfest"],"created_at":"2024-08-02T20:00:47.708Z","updated_at":"2025-04-14T08:38:07.470Z","avatar_url":"https://github.com/utopia-php.png","language":"PHP","readme":"# Utopia WebSocket\n\n[![Build Status](https://travis-ci.com/utopia-php/system.svg?branch=main)](https://travis-ci.com/utopia-php/websocket)\n![Total Downloads](https://img.shields.io/packagist/dt/utopia-php/websocket.svg)\n[![Discord](https://img.shields.io/discord/564160730845151244?label=discord)](https://appwrite.io/discord)\n\nUtopia WebSocket is a simple and lite abstraction layer around a WebSocket server. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io).\n\nAlthough this library is part of the [Utopia Framework](https://github.com/utopia-php/framework) project it is dependency free and can be used as standalone with any other PHP project or framework.\n\n## Getting Started\n\nInstall using composer:\n```bash\ncomposer require utopia-php/websocket\n```\n\nInit in your application:\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/../../vendor/autoload.php';\n\nuse Utopia\\WebSocket;\n\n$adapter = new WebSocket\\Adapter\\Swoole();\n$adapter-\u003esetPackageMaxLength(64000);\n\n$server = new WebSocket\\Server($adapter);\n$server-\u003eonStart(function () {\n    echo \"Server started!\";\n});\n$server-\u003eonWorkerStart(function (int $workerId) {\n    echo \"Worker {$workerId} started!\";\n});\n$server-\u003eonOpen(function (int $connection, $request) {\n    echo \"Connection {$connection} established!\";\n});\n$server-\u003eonMessage(function (int $connection, string $message) {\n    echo \"Message from {$connection}: {$message}\";\n});\n$server-\u003eonClose(function (int $connection) {\n    echo \"Connection {$workerId} closed!\";\n});\n\n$server-\u003estart();\n```\n\n## System Requirements\n\nUtopia Framework requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.\n\n## Copyright and license\n\nThe MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n","funding_links":[],"categories":["HTTP and WebSocket"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopia-php%2Fwebsocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futopia-php%2Fwebsocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopia-php%2Fwebsocket/lists"}