workerman 作为WSS客户端报错

defence

问题描述

按照示例的代码尝试链接WSS报错

程序代码

        $con = new AsyncTcpConnection('wss://ws.yuming.com:2888');

        // 设置以ssl加密方式访问,使之成为wss
        $con->transport = 'ssl';

        $con->onConnect = function(AsyncTcpConnection $con) {
            $con->send('hello');
        };

        $con->onMessage = function(AsyncTcpConnection $con, $data) {
            echo $data;
        };

        $con->connect();

报错信息

Exception: class \Protocols\Wss not exist in /demo/server/vendor/workerman/workerman/Connection/AsyncTcpConnection.php:155
Stack trace:

操作系统及workerman/webman等框架组件具体版本

Workerman version:4.0.27
PHP version:7.2.33

1574 1 0
1个回答

小W

ws://ws.yuming.com:2888

年代过于久远,无法发表回答
×
🔝