k8s/ws-ratchet 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

k8s/ws-ratchet

最新稳定版本:1.1.1

Composer 安装命令:

composer require k8s/ws-ratchet

包简介

Ratchet based websocket adapter for k8s/client

README 文档

README

This library provides a Ratchet based websocket adapter for the k8s/client library.

General Use with the K8s library / Configuration Options

  1. Install the library:

composer require k8s/ws-ratchet

Note: If you don't need to change any TLS settings, this is all that is needed.

  1. If you need to configure any options, then you can use the below method to set those and use the websocket with them:
use K8s\Client\K8s;
use K8s\Client\Options;
use K8s\WsRatchet\RatchetWebsocketAdapter;

$options = [
    # Set a timeout for the websocket connection
    'timeout' => 15,
    # Can toggle these to false if you are using a self-signed cert
    'tls' => [
        'verify_peer' => true,
        'verify_peer_name' => true,
    ],
];

$websocket = new RatchetWebsocketAdapter($options);

# You can then pass the new websocket adapter in the options to be used
$options = new Options('k8s.endpoint.local');
$options->setWebsocketClient($websocket);

# Construct K8s to use the new websocket in the options
$k8s = new K8s($options);

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-15