美文网首页
swoft websocket 配置wss

swoft websocket 配置wss

作者: 卡五星星 | 来源:发表于2021-02-25 16:40 被阅读0次
    'wsServer'           => [
            'class'    => WebSocketServer::class,
            'type' => SWOOLE_SOCK_TCP | SWOOLE_SSL,
            'port'     => 18308,
            'listener' => [
                'rpc' => bean('rpcServer'),
                // 'tcp' => bean('tcpServer'),
            ],
            'on'       => [
                // Enable http handle
                SwooleEvent::REQUEST => bean(RequestListener::class),
                // Enable task must add task and finish event
                SwooleEvent::TASK    => bean(TaskListener::class),
                SwooleEvent::FINISH  => bean(FinishListener::class)
            ],
            'debug'    => 1,
            // 'debug'   => env('SWOFT_DEBUG', 0),
            /* @see WebSocketServer::$setting */
            'setting'  => [
                'task_worker_num'       => 6,
                'task_enable_coroutine' => true,
                'worker_num'            => 6,
                'log_file'              => alias('@runtime/swoole.log'),
                'ssl_cert_file' => "/yoursslpath/fullchain.pem",
                'ssl_key_file'  => "/yoursslpath/privkey.pem"
                
                // 'open_websocket_close_frame' => true,
            ],
        ],
    

    相关文章

      网友评论

          本文标题:swoft websocket 配置wss

          本文链接:https://www.haomeiwen.com/subject/vvsufltx.html