Skip to content

takielias/codeigniter-websocket-example

Repository files navigation

CodeIgniter WebSocket Library Example

CodeIgniter library realtime communication by using Websocket technology and Ratchet (Socketo.me & codeigniter-websocket)

📚 Dependencies

  • PHP 5.6+
  • CodeIgniter Framework (3.1.* recommanded)
  • Composer
  • PHP sockets extension enabled

🔰 Installation

➡️ Step 1 : Library installation by Composer

Clone The Repository

git clone https://github.com/takielias/codeigniter-websocket-example.git

Run the following command in the folder of your project :

composer install

You'r almost done ✔️

Open you'r command prompt then type the command bellow in you'r project folder :

php index.php welcome index

➡️ Test the App

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

http://localhost/codeigniter-websocket-example/index.php/user/index/1

http://localhost/codeigniter-websocket-example/index.php/user/index/2

❗ In my example, recipient_id is defined by user_id, as you can see, it's the auth callback who defines recipient ids.

If you have something like that, everything is ok for you:

user_1

user_2

Bugs 🐛 or feature 💪

Be free to open an issue or send pull request

Releases

No releases published

Packages

No packages published

Languages