#### 问题描述
我想实现一个安装时实时显示安装进度的功能,想在控制器中使用sse,于是在搜了一下帖子,找到了这个帖子
https://www.workerman.net/q/11773 按照他的样子测试了一下connection->send(new Response(200, ['Content-Type' => 'text/event-stream'], "\r\n"));
// 定时向客户端推送数据Timer::del($timer_id);
return;
}
// 发送message事件,事件携带的数据为hello,消息id可以不传
$connection->send(new ServerSentEvents(['event' => ''data' => 'hello', 'id' => 1]));
});
} else {
/**
* 验证参数