File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 1111 'port ' => '9000 ' ,
1212 'type ' => SWOOLE_SOCK_TCP ,
1313 'setting ' => [
14- 'open_http_protocol ' => false ,
15- 'open_websocket_protocol ' => true ,
16- 'task_worker_num ' => 1 ,
14+ 'daemonize ' => false ,
15+ 'task_worker_num ' => 1 ,
1716 ],
1817 'handler ' => \swoole_websocket_and_tcp_and_udp_test \webscoket::class,
1918 ],
2221 'host ' => '0.0.0.0 ' ,
2322 'port ' => '9001 ' ,
2423 'type ' => SWOOLE_SOCK_TCP ,
25- 'setting ' => [
26- 'open_http_protocol ' => true ,
27- 'daemonize ' => false ,
28- ],
24+ 'setting ' => [],
2925 'handler ' => \swoole_websocket_and_tcp_and_udp_test \http::class,
3026 ],
3127 'tcp ' => [
Original file line number Diff line number Diff line change @@ -35,10 +35,23 @@ public function __construct($config)
3535 if (isset ($ this ->config ['websocket ' ])) {
3636 $ this ->enableWebsocket = true ;
3737 $ this ->primaryConfig = $ this ->config ['websocket ' ];
38+ $ this ->primaryConfig ['setting ' ]['open_websocket_protocol ' ] = true ;
39+ if (!isset ($ this ->primaryConfig ['setting ' ]['open_http_protocol ' ])) {
40+ $ this ->primaryConfig ['setting ' ]['open_http_protocol ' ] = true ;
41+ }
42+ if (!isset ($ this ->primaryConfig ['setting ' ]['daemonize ' ])) {
43+ $ this ->primaryConfig ['setting ' ]['daemonize ' ] = false ;
44+ }
45+
3846 $ serverClass = \swoole_websocket_server::class;
3947 } else {
4048 if (isset ($ this ->config ['http ' ])) {
4149 $ this ->primaryConfig = $ this ->config ['http ' ];
50+ $ this ->primaryConfig ['setting ' ]['open_http_protocol ' ] = true ;
51+ if (!isset ($ this ->primaryConfig ['setting ' ]['daemonize ' ])) {
52+ $ this ->primaryConfig ['setting ' ]['daemonize ' ] = false ;
53+ }
54+
4255 $ serverClass = \swoole_http_server::class;
4356 }
4457 }
You can’t perform that action at this time.
0 commit comments