From 6a739172649dd5304edb34c9576f0a8cf1f3f1aa Mon Sep 17 00:00:00 2001 From: ykxiao Date: Thu, 3 Jul 2025 21:18:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9clientID=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=97=B6=E8=BF=94=E5=9B=9Ecode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/push.js | 2 +- routes/stream.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/routes/push.js b/routes/push.js index 89c6478..41f917b 100644 --- a/routes/push.js +++ b/routes/push.js @@ -31,7 +31,7 @@ router.post('/', (req, res) => { if (client_id) { const clientRes = clients.get(client_id); if (!clientRes) { - return res.status(404).json({ error: `Client ${client_id} not found` }); + return res.status(200).json({ error: `Client ${client_id} not found` }); } clientRes.write(`data: ${JSON.stringify(payload)}\n\n`); diff --git a/routes/stream.js b/routes/stream.js index c637752..17cf9bc 100644 --- a/routes/stream.js +++ b/routes/stream.js @@ -23,6 +23,7 @@ router.get('/', (req, res) => { res.write(`data: ${JSON.stringify({ status: 'connected', clientId, + clientCount: clients.size(), time: timestamp.formatTime() })}\n\n`);