Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
laravelzh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冯超鹏
laravelzh
Commits
0ebd3b5a
Commit
0ebd3b5a
authored
Dec 08, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp连接禁用ssl
parent
009f2adb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
swooleMeTcp.php
app/Console/Commands/swooleMeTcp.php
+10
-6
No files found.
app/Console/Commands/swooleMeTcp.php
View file @
0ebd3b5a
...
...
@@ -55,10 +55,14 @@ class swooleMeTcp extends Command
public
function
start
()
{
$url
=
config
(
'public.swooletcpurl'
);
$this
->
tcp
=
new
\swoole_server
(
'0.0.0.0'
,
9503
,
SWOOLE_PROCESS
,
SWOOLE_SOCK_TCP
|
SWOOLE_SSL
);
$this
->
tcp
->
addlistener
(
'0.0.0.0'
,
9504
,
SWOOLE_SOCK_TCP
|
SWOOLE_SSL
);
// 添加 TCP端口监听
$this
->
tcp
->
addlistener
(
'0.0.0.0'
,
9505
,
SWOOLE_SOCK_TCP
|
SWOOLE_SSL
);
// 添加 TCP端口监听
$this
->
tcp
->
addlistener
(
'0.0.0.0'
,
9506
,
SWOOLE_SOCK_TCP
|
SWOOLE_SSL
);
// 添加 TCP端口监听
// $this->tcp = new \swoole_server('0.0.0.0', 9503, SWOOLE_PROCESS,SWOOLE_SOCK_TCP | SWOOLE_SSL);
//// $this->tcp->addlistener('0.0.0.0', 9504, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
//// $this->tcp->addlistener('0.0.0.0', 9505, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
//// $this->tcp->addlistener('0.0.0.0', 9506, SWOOLE_SOCK_TCP | SWOOLE_SSL); // 添加 TCP端口监听
$this
->
tcp
=
new
\swoole_server
(
'0.0.0.0'
,
9503
,
SWOOLE_PROCESS
,
SWOOLE_SOCK_TCP
);
$this
->
tcp
->
addlistener
(
'0.0.0.0'
,
9504
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$this
->
tcp
->
addlistener
(
'0.0.0.0'
,
9505
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$this
->
tcp
->
addlistener
(
'0.0.0.0'
,
9506
,
SWOOLE_SOCK_TCP
);
// 添加 TCP端口监听
$this
->
tcp
->
set
([
'worker_num'
=>
2
,
//设置启动的 Worker 进程数
'max_request'
=>
30
,
//最大任务数
...
...
@@ -67,8 +71,8 @@ class swooleMeTcp extends Command
'backlog'
=>
128
,
'heartbeat_check_interval'
=>
30
,
'heartbeat_idle_time'
=>
65
,
'ssl_cert_file'
=>
base_path
()
.
config
(
'app.ssl_cert_file'
),
'ssl_key_file'
=>
base_path
()
.
config
(
'app.ssl_key_file'
),
//
'ssl_cert_file' => base_path() . config('app.ssl_cert_file'),
//
'ssl_key_file' => base_path() . config('app.ssl_key_file'),
]);
//监听连接进入事件
$this
->
tcp
->
on
(
'Connect'
,
function
(
$serv
,
$fd
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment