andreibu / php_websocket_client
PHP WebSocket 客户端 For Laravel。
0.2
2017-03-24 15:00 UTC
Requires
- php: >=5.3.23
This package is not auto-updated.
Last update: 2024-09-28 20:09:20 UTC
README
安装
composer require andreibu/php_websocket_client
Laravel 5
设置
将 ServiceProvider 添加到 config/app.php 中的 providers 数组。
'providers' => [
...
AndreiBu\php_websocket_client\WSServiceProvider::class,
],
'aliases' => [
...
'PHP_WS' => AndreiBu\php_websocket_client\Facades\PHP_WS::class,
],
配置
host
port
path
使用
send
use PHP_WS; PHP_WS::send(json_encode(array('type'=>'send_message_to','id'=>'1000001','msg'=>'laravel msg ')));