{"id":14987318,"url":"https://github.com/takielias/codeigniter4-websocket","last_synced_at":"2025-09-13T05:47:00.461Z","repository":{"id":36656954,"uuid":"229313955","full_name":"takielias/codeigniter4-websocket","owner":"takielias","description":"Codeigniter 4 Websocket Built for real-time application","archived":false,"fork":false,"pushed_at":"2024-01-03T15:41:11.000Z","size":57,"stargazers_count":86,"open_issues_count":11,"forks_count":27,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-09-08T20:07:25.958Z","etag":null,"topics":["codeigniter4","real-time","websocket"],"latest_commit_sha":null,"homepage":"https://ebuz.xyz","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/takielias.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2019-12-20T18:09:46.000Z","updated_at":"2025-06-08T17:12:09.000Z","dependencies_parsed_at":"2024-01-03T16:43:48.907Z","dependency_job_id":"aa8ea8a3-69ea-4dba-8cce-c18375f57c86","html_url":"https://github.com/takielias/codeigniter4-websocket","commit_stats":{"total_commits":20,"total_committers":3,"mean_commits":6.666666666666667,"dds":0.65,"last_synced_commit":"8bd3d308dfe24a262c434043f92be193752c82b3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/takielias/codeigniter4-websocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takielias%2Fcodeigniter4-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takielias%2Fcodeigniter4-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takielias%2Fcodeigniter4-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takielias%2Fcodeigniter4-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takielias","download_url":"https://codeload.github.com/takielias/codeigniter4-websocket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takielias%2Fcodeigniter4-websocket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274922856,"owners_count":25374556,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["codeigniter4","real-time","websocket"],"created_at":"2024-09-24T14:14:26.463Z","updated_at":"2025-09-13T05:47:00.393Z","avatar_url":"https://github.com/takielias.png","language":"PHP","readme":"[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/takielias/codeigniter4-websocket\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/38932580/71325065-b6d05600-2511-11ea-9169-694185c48f8b.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n  \n  \u003ch3 align=\"center\"\u003eCodeIgniter 4 WebSocket Library\u003c/h3\u003e\n\n\u003ca href=\"https://www.buymeacoffee.com/takielias\" target=\"_blank\"\u003e \u003cimg align=\"left\" src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" height=\"50\" width=\"210\" alt=\"takielias\" /\u003e\u003c/a\u003e\n\u003c/a\u003e\n\u003cbr\u003e\u003cbr\u003e\n\nCodeIgniter WebSocket library. It allows you to make powerfull realtime applications by using Ratchet [Socketo.me](http://socketo.me) Websocket technology.\n\n#### WebSocket Library for Codeigniter 3.x https://github.com/takielias/codeigniter-websocket\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n## Table of Contents\n\n* [Getting Started](#getting-started)\n  * [Prerequisites](#prerequisites)\n  * [Installation](#installation)\n  * [Publishing](#publishing)\n* [Usage](#usage)\n  * [Authentication and callbacks](#authentication-and-callbacks)\n* [Roadmap](#roadmap)\n* [Contributing](#contributing)\n* [License](#license)\n* [Contact](#contact)\n* [Acknowledgements](#acknowledgements)\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nThis is an example of how you may give instructions on setting up your project locally.\nTo get a local copy up and running follow these simple example steps.\n\n### Prerequisites\n\n- PHP 7.2+\n- CodeIgniter Framework (4.* recommended)\n- Composer\n- PHP sockets extension enabled\n\n### Installation\n\n```sh\ncomposer require takielias/codeigniter4-websocket @dev\n```\n### Publishing Resource\nYou need to publish the resources for the default configuration\n```sh\nphp spark websocket:publish\n```\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\nFirst start CodeIgniter\n```sh\nphp spark serve\n```\n\nIf you run the server in a different port, follow the command below.\n```sh\nPHP spark serve --port=9092\n```\n\n**Finally start Websocket Server**\n```sh\nphp public/index.php Websocket start\n```\n**N.B** : Don't forget to add the following line in app/Config/Routes.php `app/Config/Routes.php`\n\n```php\n$routes-\u003esetAutoRoute(true);\n```\n\n**WOW You made it !!!** :heavy_check_mark: \n\nOpen two pages of your project on the following URL with different IDs :\n\n**For default Port**\n`http://localhost:8080/Websocket/user/1`\n`http://localhost:8080/Websocket/user/2`\n\n**For custom Port**\n`http://localhost:9092/Websocket/user/1`\n`http://localhost:9092/Websocket/user/2`\n\n\u003c!-- Authentication \u0026 callbacks --\u003e\n## Authentication and callbacks\n\nThere are few predefined callbacks, here's the list :\n\n` auth, event, close, citimer, roomjoin, roomleave, roomchat `\n\nPlease check Websocket.php controller To get the Defining example of various Callback Function\n\n```sh\n    public function start()\n    {\n        $ws = service('CodeigniterWebsocket');\n        $ws-\u003eset_callback('auth', array($this, '_auth'));\n        $ws-\u003eset_callback('event', array($this, '_event'));\n        $ws-\u003erun();\n    }\n\n    public function _auth($datas = null)\n    {\n        // Here you can verify everything you want to perform user login.\n\n        return (!empty($datas-\u003euser_id)) ? $datas-\u003euser_id : false;\n    }\n\n    public function _event($datas = null)\n    {\n        // Here you can do everything you want, each time message is received \n        echo 'Hey ! I\\'m an EVENT callback' . PHP_EOL;\n    }\n\n ```   \nTwo Callback functions have been defined in the above example. First One is **auth** \u0026 the Second one is **event**.\n \n###### 🔨🔨🔨 If you need to customize Callback function, Please check the CodeigniterWebsocker.php config file in Your config directory.\n\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\nSee the [open issues](https://github.com/takielias/codeigniter4-websocket/issues) for a list of proposed features (and known issues).\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what makes the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nTaki Elias - [@takiele](https://twitter.com/takiele) - [https://ebuz.xyz](https://ebuz.xyz) - taki.elias@gmail.com\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n## Acknowledgements\n* [http://socketo.me](https://github.com/ratchetphp/Ratchet)\n* [Websocket Client for PHP](https://github.com/Textalk/websocket-php)\n* [Choose an Open Source License](https://choosealicense.com)\n* [GitHub Pages](https://pages.github.com)\n* [Animate.css](https://daneden.github.io/animate.css)\n* [Loaders.css](https://connoratherton.com/loaders)\n* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)\n* [Font Awesome](https://fontawesome.com)\n\n\n## Support on Buy Me A Coffee\nHey dude! Help me out for a cup of ☕!\n\n\u003ca href=\"https://www.buymeacoffee.com/takielias\" target=\"_blank\"\u003e \u003cimg align=\"left\" src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" height=\"50\" width=\"210\" alt=\"takielias\" /\u003e\u003c/a\u003e\n\u003c/a\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/takielias/codeigniter4-websocket.svg?style=flat-square\n[contributors-url]: https://github.com/takielias/codeigniter4-websocket/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/takielias/codeigniter4-websocket.svg?style=flat-square\n[forks-url]: https://github.com/takielias/codeigniter4-websocket/network/members\n[stars-shield]: https://img.shields.io/github/stars/takielias/codeigniter4-websocket.svg?style=flat-square\n[stars-url]: https://github.com/takielias/codeigniter4-websocket/stargazers\n[issues-shield]: https://img.shields.io/github/issues/takielias/codeigniter4-websocket.svg?style=flat-square\n[issues-url]: https://github.com/takielias/codeigniter4-websocket/issues\n[license-shield]: https://img.shields.io/github/license/takielias/codeigniter4-websocket.svg?style=flat-square\n[license-url]: https://github.com/takielias/codeigniter4-websocket/blob/master/LICENSE.txt\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/takielias\n[product-screenshot]: images/screenshot.png\n\n[ico-version]: https://img.shields.io/packagist/v/takielias/codeigniter4-websocket.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/takielias/codeigniter4-websocket.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/takielias/codeigniter4-websocket\n[link-downloads]: https://packagist.org/packages/takielias/codeigniter4-websocket\n[link-author]: https://github.com/takielias\n","funding_links":["https://www.buymeacoffee.com/takielias"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakielias%2Fcodeigniter4-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakielias%2Fcodeigniter4-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakielias%2Fcodeigniter4-websocket/lists"}