no commit message

This commit is contained in:
annnj-company
2026-04-24 09:44:41 +08:00
parent 2838f08ac0
commit 67b175894a
3 changed files with 11 additions and 112 deletions

View File

@@ -16,7 +16,12 @@ $uidConnectionMap = [];
// 模拟推送的数值
$push_value = rand(100, 1000);
// PHPSocketIO服务
$sender_io = new SocketIO($socket_port);
// 添加CORS支持配置
$sender_io = new SocketIO($socket_port, array(
'allowOrigin' => '*',
'allowMethods' => 'GET, POST, OPTIONS',
'allowHeaders' => 'Content-Type',
));
// 客户端发起连接事件
$sender_io->on('connection', function($socket) use (&$push_value){