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){ // 当客户端发来登录事件时触发