CodeIgniter Forums
CodeIgniter 4 Websocket - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Addins (
+--- Thread: CodeIgniter 4 Websocket (/thread-75104.html)

CodeIgniter 4 Websocket - takielias - 12-21-2019

I have been working for a few weeks to make a simple Websocket Library for Codeigniter 4

What is Codeigniter Websocket?

[Image: 71280886-acce1c00-2386-11ea-95d7-23e1775d3724.png]

CodeIgniter WebSocket library. It allows you to make powerful realtime applications by using Ratchet Websocket technology.

- Secure Auth system using Json Web Token
- Fully customize callback functions to handle different events

Though it's on the Beta version, you may give a try.


composer require takielias/codeigniter4-websocket @dev

Publishing Resource

You need to publish the resources for the default configuration

php spark websocket:publish


First start CodeIgniter

php spark serve

If you run the server in a different port, follow the command below.

php spark serve --port=9092

Finally start Websocket Server

php public/index.php Websocket start

WOW, You made it !!! ✔️

Open two pages of your project on the following URL with different IDs :

For default Port


For custom Port


Github Link: CodeIgniter 4 WebSocket Library

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Smile

RE: CodeIgniter 4 Websocket - xteksuox - 05-02-2020

Thank you very much, I don't know much about websocket but I always need to start the server to make it work or does it work ??

RE: CodeIgniter 4 Websocket - takielias - 05-03-2020

(05-02-2020, 07:49 AM)xteksuox Wrote: Thank you very much, I don't know much about websocket but I always need to start the server to make it work or does it work ??

yes It works.

RE: CodeIgniter 4 Websocket - kristianlake - 03-03-2021

This looks awesome, does it do pub/sub too?

I'm looking for a websocket I can subscribe to topics with.

RE: CodeIgniter 4 Websocket - albertleao - 03-03-2021

Hey! Very interesting.

Have you load tested this? I'm curious how many sockets you can support on a basic server like an t3.medium instance.

Any chance you have some unit tests?