承接 woodylan/go-websocket-php-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

woodylan/go-websocket-php-sdk

最新稳定版本:v1.0.0

Composer 安装命令:

composer require woodylan/go-websocket-php-sdk

包简介

WebSocket微服务PHP SDK

README 文档

README

go-websocket 项目地址:https://github.com/woodylan/go-websocket

安装

Composer

composer require woodylan/go-websocket-php-sdk

使用

// 导入类
use Woodylan\Websocket\WsServer;
// 实例化
$wsServer = new WsServer('https://ws.example.com', '660');
// 例子 注册系统
$wsServer->register('xxxxx');

接口列表

  1. 注册系统

    $wsServer->register($systemId);
  2. 发送给指定clientId

    $wsServer->sendToClientId($systemId, $clientId, $sendUserId, $code, $msg, $data);
  3. 发送给指定clientIds

    $wsServer->sendToClientIds($systemId, $clientIds, $sendUserId, $code, $msg, $data);
  4. 绑定clientId到分组

    $wsServer->bindToGroup($systemId, $groupName, $clientId, $userId = '');
  5. 发送消息给指定分组

    $wsServer->sendToGroup($systemId, $groupName, $sendUserId, $code, $msg, $data);
  6. 获取在线客户端列表

    $wsServer->getOnlineList($systemId, $groupName = '');

统计信息

  • 总下载量: 2.8k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-15