定制 textalk/websocket 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

textalk/websocket

最新稳定版本:1.6.3

Composer 安装命令:

composer require textalk/websocket

包简介

WebSocket client and server

README 文档

README

Build Status Coverage Status

Archived project

This project has been archived and is no longer maintained. No bug fix and no additional features will be added.
You won't be able to submit new issues or pull requests, and no additional features will be added

This library has been replaced by sirn-se/websocket-php

Websocket Client and Server for PHP

This library contains WebSocket client and server for PHP.

The client and server provides methods for reading and writing to WebSocket streams. It does not include convenience operations such as listeners and implicit error handling.

Documentation

Installing

Preferred way to install is with Composer.

composer require textalk/websocket
  • Current version support PHP versions ^7.4|^8.0.
  • For PHP 7.2 and 7.3 support use version 1.5.
  • For PHP 7.1 support use version 1.4.
  • For PHP ^5.4 and 7.0 support use version 1.3.

Client

The client can read and write on a WebSocket stream. It internally supports Upgrade handshake and implicit close and ping/pong operations.

$client = new WebSocket\Client("ws://echo.websocket.org/");
$client->text("Hello WebSocket.org!");
echo $client->receive();
$client->close();

Server

The library contains a rudimentary single stream/single thread server. It internally supports Upgrade handshake and implicit close and ping/pong operations.

Note that it does not support threading or automatic association ot continuous client requests. If you require this kind of server behavior, you need to build it on top of provided server implementation.

$server = new WebSocket\Server();
$server->accept();
$message = $server->receive();
$server->text($message);
$server->close();

License and Contributors

ISC License

Fredrik Liljegren, Armen Baghumian Sankbarani, Ruslan Bekenev, Joshua Thijssen, Simon Lipp, Quentin Bellus, Patrick McCarren, swmcdonnell, Ignas Bernotas, Mark Herhold, Andreas Palm, Sören Jensen, pmaasz, Alexey Stavrov, Michael Slezak, Pierre Seznec, rmeisler, Nickolay V. Shmyrev, Christoph Kempen, Marc Roberts, Antonio Mora, Simon Podlipsky, etrinh.

统计信息

  • 总下载量: 18.03M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 969
  • 点击次数: 3
  • 依赖项目数: 163
  • 推荐数: 3

GitHub 信息

  • Stars: 935
  • Watchers: 38
  • Forks: 255
  • 开发语言: PHP

其他信息

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