gateway.php 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. return [
  3. // 扩展自身需要的配置
  4. 'protocol' => 'websocket', // 协议 支持 tcp udp unix http websocket text
  5. 'host' => '0.0.0.0', // 监听地址
  6. 'port' => env('worker_port',8282), // 监听端口
  7. 'socket' => '', // 完整监听地址
  8. 'context' => [], // socket 上下文选项
  9. 'register_deploy' => env('worker_register_deploy',true), // 是否需要部署register
  10. 'businessWorker_deploy' => true, // 是否需要部署businessWorker
  11. 'gateway_deploy' => true, // 是否需要部署gateway
  12. // Register配置
  13. 'registerAddress' => env('worker_register_address','127.0.0.1:1236'),
  14. // Gateway配置
  15. 'name' => env('worker_name','pushGateWay'),
  16. 'count' => env('worker_count',1),
  17. 'lanIp' => env('worker_lan_ip','127.0.0.1'),
  18. 'startPort' => env('worker_start_port',2300),
  19. 'daemonize' => false,
  20. 'pingInterval' => 20,
  21. 'pingNotResponseLimit' => 0,
  22. 'pingData' => '{"type":"ping"}',
  23. // BusinsessWorker配置
  24. 'businessWorker' => [
  25. 'name' => 'BusinessWorker',
  26. 'count' => 1,
  27. 'eventHandler' => 'app\worker\Events',
  28. ],
  29. ];