Slide 42
Slide 42 text
Important part that's missing: res.end() and the
response object is cached for use later on.
app.get('/remote/:id/run', function (req, res) {
var id = req.params.id;
res.writeHead(200, {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache'
});
res.write('id:0\n\n');
sessions.run[id] = res;
});