dickyermawan/yii2-socketio
Composer 安装命令:
composer require dickyermawan/yii2-socketio
包简介
Socket.IO for real-time app
README 文档
README
Socket.IO for real-time app
Installation
The preferred way to install this extension is through composer.
Either run
composer require dickyermawan/yii2-socketio
or add
"dickyermawan/yii2-socketio": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
//in components array 'socket' => [ 'class' => 'dickyermawan\socketio\ElephantIo', 'host' => 'http://localhost:8089', 'options' => [ 'headers' => [ 'X-My-Header: MyHead', 'Authorization: Bearer 12345asdf' ] ] ] //in your controller: Yii::$app->socket->emit('realTime', [ 'param1' => 'param1', 'param2' => 'param2' ]); Yii::$app->socket->close();
统计信息
- 总下载量: 82
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-28