Event Stream data not showing in Chrome console
I had the same issue. The data does not show up when you are using the eventsource polyfill only when you use the built in browser implementation of the EventSource class.
I had the same issue. The data does not show up when you are using the eventsource polyfill only when you use the built in browser implementation of the EventSource class.
Try streamqueue. var streamqueue = require(‘streamqueue’); gulp.task(‘css’, function () { return streamqueue({ objectMode: true }, gulp.src([‘dev/css/reset.css’, ‘dev/css/style.css’, ‘dev/css/typography.css’, ‘dev/css/sizes.css’]), gulp.src([‘dev/css/*.scss’]).pipe(sass()) ) .pipe(concat(‘main.css’)) .pipe(minifyCSS()) .pipe(gulp.dest(‘build/css’)) }); This cheatsheet will help you. PDF is here.
You should name the function you attach as event handler. Then on removing it, you just pass the function by name: app.get(‘/api/:boardname/remoterefresh’, function(req, res){ var boardname = req.param(‘boardname’) function refreshHandler(data){ setTimeout(function(){ res.write(‘data: ‘+data+’\n\n’); }, 1000) } rr.on(“refresh-“+boardname, refreshHandler); req.socket.setTimeout(Infinity); res.writeHead(200, { ‘Content-Type’: ‘text/event-stream’, ‘Cache-Control’: ‘no-cache’, ‘Connection’: ‘keep-alive’ }); res.write(‘\n’); req.on(‘close’, function(){ console.log(‘closed’) rr.removeListener(“refresh-“+boardname, refreshHandler); }); … Read more