A simple chat application in CodeIgniter using websocket with Ratchet. Integrated with models, libraries, helpers and CI stuff.
- Get the project from this repository
- Install composer
- In your computer, go to the project root directory and run
composer install
to install the dependencies
- Configure base URL in
application/config/config.php
(line 26), if you have one - Configure the websocket port in
application/config/constants.php
(line 87), or leave it with default value
- Go to the project root directory and run
php index.php ratchet/bin/RatchetServer
and let server running. - Open two tabs in your browser and access
http://[your_domain]/ratchet/demo
and have fun!
- Ratchet Server:
application/controllers/ratchet/bin/RatchetServer.php
- Ratchet Class:
application/controllers/ratchet/Ratchet.php
- Chat Controller:
application/controllers/ratchet/Demo.php
- Chat View:
application/views/ratchet/ratchet.php
(the websocket connection is here)