~~~
return [
'server' => [ //ws 服务器
'server_type' => \One\Swoole\OneServer::SWOOLE_WEBSOCKET_SERVER,
'port' => 8082,
'action' => \App\Test\MixPro\Ws::class,
'mode' => SWOOLE_PROCESS,
'sock_type' => SWOOLE_SOCK_TCP,
'ip' => '0.0.0.0',
'set' => [
'worker_num' => 5
]
],
'add_listener' => [
[ // http 服务器
'port' => 8081,
'action' => \App\Server\AppHttpPort::class,
'type' => SWOOLE_SOCK_TCP,
'ip' => '0.0.0.0',
'set' => [
'open_http_protocol' => true,
'open_websocket_protocol' => false
]
],
[ // tcp 服务器
'port' => 8083,
'pack_protocol' => \One\Protocol\Text::class,
'action' => \App\Test\MixPro\TcpPort::class,
'type' => SWOOLE_SOCK_TCP,
'ip' => '0.0.0.0',
'set' => [
'open_http_protocol' => false,
'open_websocket_protocol' => false
]
]
]
];
~~~