From a9b53af67f325082d214ebee0ae23efbb5e6a9df Mon Sep 17 00:00:00 2001
From: 何书鹏 <heshupeng@bronet.cn>
Date: Fri, 13 May 2022 17:38:32 +0800
Subject: [PATCH] phpsocket.io ssl证书

---
 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