no commit message
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user