reiniciar por room, finished ya no estorba, control total desde el dashboard

This commit is contained in:
2025-08-16 00:13:31 -06:00
parent cc0a628145
commit 63eb9b2c7e
5 changed files with 35 additions and 33 deletions

View File

@@ -527,14 +527,17 @@ adminRouter.get("/admin/uuids-with-names", async (req: Request, res: Response) =
// SSE endpoint for real-time dashboard updates
adminRouter.get("/dashboard-stream", (req: Request, res: Response) => {
// Set SSE headers
// Set SSE headers (hardened for reverse proxies)
res.writeHead(200, {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache',
'Cache-Control': 'no-cache, no-transform', // avoid proxy transformations
'Connection': 'keep-alive',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'Cache-Control'
'Access-Control-Allow-Headers': 'Cache-Control',
'X-Accel-Buffering': 'no' // hint nginx to disable buffering
});
// Flush headers immediately so proxies establish the stream
try { (res as any).flushHeaders?.(); } catch {}
// Add client to our set
sseClients.add(res);