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 11
11
'port ' => '9000 ' ,
12
12
'type ' => SWOOLE_SOCK_TCP ,
13
13
'setting ' => [
14
- 'open_http_protocol ' => false ,
15
- 'open_websocket_protocol ' => true ,
16
- 'task_worker_num ' => 1 ,
14
+ 'daemonize ' => false ,
15
+ 'task_worker_num ' => 1 ,
17
16
],
18
17
'handler ' => \swoole_websocket_and_tcp_and_udp_test \webscoket::class,
19
18
],
22
21
'host ' => '0.0.0.0 ' ,
23
22
'port ' => '9001 ' ,
24
23
'type ' => SWOOLE_SOCK_TCP ,
25
- 'setting ' => [
26
- 'open_http_protocol ' => true ,
27
- 'daemonize ' => false ,
28
- ],
24
+ 'setting ' => [],
29
25
'handler ' => \swoole_websocket_and_tcp_and_udp_test \http::class,
30
26
],
31
27
'tcp ' => [
Original file line number Diff line number Diff line change @@ -35,10 +35,23 @@ public function __construct($config)
35
35
if (isset ($ this ->config ['websocket ' ])) {
36
36
$ this ->enableWebsocket = true ;
37
37
$ 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
+
38
46
$ serverClass = \swoole_websocket_server::class;
39
47
} else {
40
48
if (isset ($ this ->config ['http ' ])) {
41
49
$ 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
+
42
55
$ serverClass = \swoole_http_server::class;
43
56
}
44
57
}
You can’t perform that action at this time.
0 commit comments