...
|
...
|
@@ -19,14 +19,7 @@ class Server |
|
|
public function index(){
|
|
|
header("Access-Control-Allow-Origin: *");
|
|
|
// PHPSocketIO服务
|
|
|
$context = array(
|
|
|
'ssl' => array(
|
|
|
'local_cert' => '/usr/local/nginx/uploads/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);
|
|
|
$sender_io = new SocketIO(2120);
|
|
|
// 客户端发起连接事件时,设置连接socket的各种事件回调
|
|
|
$sender_io->on('connection', function($socket){
|
|
|
// 当客户端发来登录事件时触发
|
...
|
...
|
|