主服务器

    1. 'server' => [
    2. 'server_type' => \One\Swoole\OneServer::SWOOLE_HTTP_SERVER,
    3. 'port' => 8081,
    4. 'action' => \App\Server\AppHttpServer::class,
    5. 'mode' => SWOOLE_PROCESS,
    6. 'sock_type' => SWOOLE_SOCK_TCP,
    7. 'ip' => '0.0.0.0',
    8. 'set' => [
    9. // 'worker_num' => 10
    10. ],
    11. ]

    添加http监听

    1. [
    2. 'port' => 8081,
    3. 'action' => \App\Server\AppHttpPort::class,
    4. 'type' => SWOOLE_SOCK_TCP,
    5. 'ip' => '0.0.0.0',
    6. 'set' => [
    7. 'open_http_protocol' => true,
    8. 'open_websocket_protocol' => false
    9. ]
    10. ],