From 8f0a6f644a5aa10e82018a72d4f6796f7ceff641 Mon Sep 17 00:00:00 2001 From: 何书鹏 <heshupeng@bronet.cn> Date: Fri, 13 May 2022 20:33:06 +0800 Subject: [PATCH] 3 --- application/socketio/controller/Server.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/socketio/controller/Server.php b/application/socketio/controller/Server.php index aabb560..a20fbbc 100644 --- a/application/socketio/controller/Server.php +++ b/application/socketio/controller/Server.php @@ -19,7 +19,14 @@ class Server public function index(){ header("Access-Control-Allow-Origin: *"); // PHPSocketIO服务 - $sender_io = new SocketIO(2120); + $context = array( + 'ssl' => array( + 'local_cert' => '/usr/local/nginx/cert/chengyigou.cn/chengyigou.cn.crt', + 'local_pk' => '/usr/local/nginx/cert/chengyigou.cn/chengyigou.cn.key', + 'verify_peer' => false, + ) + ); + $sender_io = new SocketIO(2120,$context); // 客户端发起连接事件时,设置连接socket的各种事件回调 $sender_io->on('connection', function($socket){ // 当客户端发来登录事件时触发 -- libgit2 0.24.0