承接 gabrielbull/websocket-client 相关项目开发

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

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

gabrielbull/websocket-client

最新稳定版本:0.3.1

Composer 安装命令:

composer require gabrielbull/websocket-client

包简介

A simple PHP WebSocket Client

README 文档

README

Build Status Latest Stable Version Total Downloads License

A simple WebSocket WAMP client implemented in PHP.

This is an implementation of WAMP version 1. I have not had the time to implement WAMP 2, but if you do, that would be awesome.

Requirements

This library uses PHP 5.4+.

Install

It is recommended that you install the WebSocket client library through composer.

{ "require": { "gabrielbull/websocket-client": "dev-master" } }

Usage

Here is an example of a simple WebSocket client:

use WebSocketClient\WebSocketClient; use WebSocketClient\WebSocketClientInterface; class Client implements WebSocketClientInterface { private $client; public function onWelcome(array $data) { } public function onEvent($topic, $message) { } public function subscribe($topic) { $this->client->subscribe($topic); } public function unsubscribe($topic) { $this->client->unsubscribe($topic); } public function call($proc, $args, Closure $callback = null) { $this->client->call($proc, $args, $callback); } public function publish($topic, $message) { $this->client->publish($topic, $message); } public function setClient(WebSocketClient $client) { $this->client = $client; } } $loop = React\EventLoop\Factory::create(); $client = new WebSocketClient(new Client, $loop); $loop->run();

统计信息

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

GitHub 信息

  • Stars: 82
  • Watchers: 7
  • Forks: 30
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固