'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,
],
],
网友评论