I use node.js (Express) with server-sent events. I would like to close the event stream by closing the sse HTTP connection. Given the folllwing function:
router.get('/sse', function (req, res) {
});
how can this be achieved?
use this
res.end();
and it will work to close connection
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With