Download the PHP package scherersoftware/cake-websocket without Composer
On this page you can find all versions of the php package scherersoftware/cake-websocket. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download scherersoftware/cake-websocket
More information about scherersoftware/cake-websocket
Files in scherersoftware/cake-websocket
Package cake-websocket
Short Description Websocket plugin for CakePHP
License MIT
Homepage https://github.com/scherersoftware/cake-websocket
Informations about the package cake-websocket
Introduction
This CakePHP 3 plugin gives you an easy way to add websocket capability to your web application.
Main Packages
Requirements
- CakePHP 3.3 or higher
- PHP 7.1
Usage in 4 easy steps
Note: You can checkout our CakePHP App Template for testing it on a clean app setup with preinstalled dependencies.
1. Define a new event
Example for websocket_events.php
2. Publish the event in server context (e.g. Shell, Controller, Table...)
Example for UsersController.php
3. Let the client receive the event and define a callback
Example for ../users/index_controller.js
4. Run the websocket server shell and start testing!
Installation
1. Require the plugin
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
2. Load the plugin
The next step is to load the plugin properly inside your bootstrap.php:
3. Configure app config
- File:
/config/app.php
4. Create and configure websocket events
- File:
/config/websocket_events.php
5. Configure AppController.php
In your src/Controller/AppController.php
, insert the following pieces of code
Usage:
beforeFilter():
6. Make the JS websocket lib globally accessible under App.Websocket
- Load the file /webroot/lib/websocket.js after loading the Frontend Bridge assets
7. Setup sessions properly if not alread done
Please follow the Cake Sessions Documentation
8. Setup Apache SSL ProxyPass if necessary
Make sure these modules are activated:
- mod_proxy.so
- mod_proxy_wstunnel.so
Edit your vhosts configuration and add this to the ssl section:
Roadmap
1.1.0
- Unit Tests
- Add a websocket_connections table which stores all active connections
All versions of cake-websocket with dependencies
cakephp/cakephp Version >=4.0.0
react/event-loop Version ^1.3
react/socket Version ^1.11
cboden/ratchet Version ^0.4.4
josegonzalez/cakephp-queuesadilla Version >=0.7