Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  9] [ 1]  / answers: 1 / hits: 22848  / 8 Years ago, sun, april 17, 2016, 12:00:00

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?


More From » node.js

 Answers
5

use this



res.end();


and it will work to close connection


[#62515] Friday, April 15, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dequant

Total Points: 88
Total Questions: 99
Total Answers: 95

Location: Ukraine
Member since Sun, Dec 13, 2020
4 Years ago
dequant questions
;