1. ~~~
    2. return [
    3. 'server' => [ //ws 服务器
    4. 'server_type' => \One\Swoole\OneServer::SWOOLE_WEBSOCKET_SERVER,
    5. 'port' => 8082,
    6. 'action' => \App\Test\MixPro\Ws::class,
    7. 'mode' => SWOOLE_PROCESS,
    8. 'sock_type' => SWOOLE_SOCK_TCP,
    9. 'ip' => '0.0.0.0',
    10. 'set' => [
    11. 'worker_num' => 5
    12. ]
    13. ],
    14. 'add_listener' => [
    15. [ // http 服务器
    16. 'port' => 8081,
    17. 'action' => \App\Server\AppHttpPort::class,
    18. 'type' => SWOOLE_SOCK_TCP,
    19. 'ip' => '0.0.0.0',
    20. 'set' => [
    21. 'open_http_protocol' => true,
    22. 'open_websocket_protocol' => false
    23. ]
    24. ],
    25. [ // tcp 服务器
    26. 'port' => 8083,
    27. 'pack_protocol' => \One\Protocol\Text::class,
    28. 'action' => \App\Test\MixPro\TcpPort::class,
    29. 'type' => SWOOLE_SOCK_TCP,
    30. 'ip' => '0.0.0.0',
    31. 'set' => [
    32. 'open_http_protocol' => false,
    33. 'open_websocket_protocol' => false
    34. ]
    35. ]
    36. ]
    37. ];
    38. ~~~