通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
[textalk\websocket](https://github.com/Textalk/websocket-php) ## Documentation * [Client](https://github.com/Textalk/websocket-php/blob/master/docs/Client.md) * [Server](https://github.com/Textalk/websocket-php/blob/master/docs/Server.md) * [Message](https://github.com/Textalk/websocket-php/blob/master/docs/Message.md) * [Examples](https://github.com/Textalk/websocket-php/blob/master/docs/Examples.md) * [Changelog](https://github.com/Textalk/websocket-php/blob/master/docs/Changelog.md) * [Contributing](https://github.com/Textalk/websocket-php/blob/master/docs/Contributing.md) ## 安装 ~~~ composer require textalk/websocket ~~~ * 当前版本支持php`^7.2|8.0`. * PHP`7.1`支持版本为`1.4`. * PHP`^5.4`和`7.0`支持版本为`1.3` ## Client 客户端可以读取和写入 WebSocket 流。 它内部支持升级握手和隐式关闭和乒乓操作。 ~~~ $client = new WebSocket\Client("ws://echo.websocket.org/"); $client->text("Hello WebSocket.org!"); echo $client->receive(); $client->close(); ~~~ ## Server 该库包含一个基本的单流/单线程服务器。 它内部支持升级握手和隐式关闭和乒乓操作。 请注意,它不支持线程或连续客户端请求的自动关联。 如果您需要这种服务器行为,则需要在提供的服务器实现之上构建它。 ~~~html $server = new WebSocket\Server(); $server->accept(); $message = $server->receive(); $server->text($message); $server->close(); ~~~ ## swoole+websocket+textalk+ssl+https](http://www.manongjc.com/detail/19-znpvpqoidqzashs.html)