mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 14:56:01 +00:00
stream filtering by connection id
This commit is contained in:
@@ -77,6 +77,7 @@ function start() {
|
||||
}
|
||||
|
||||
app.get(getExpressPath('/stream'), async function (req, res) {
|
||||
const strmid = req.query.strmid;
|
||||
res.set({
|
||||
'Cache-Control': 'no-cache',
|
||||
'Content-Type': 'text/event-stream',
|
||||
@@ -87,9 +88,9 @@ function start() {
|
||||
|
||||
// Tell the client to retry every 10 seconds if connectivity is lost
|
||||
res.write('retry: 10000\n\n');
|
||||
socket.addSseResponse(res);
|
||||
socket.addSseResponse(res, strmid);
|
||||
onFinished(req, () => {
|
||||
socket.removeSseResponse(res);
|
||||
socket.removeSseResponse(strmid);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user