AmvTek blog

complex web systems

Improving EventSource browser support

We are happy to opensource a Polyfill that we are using extensively, which will let you use the EventSource in all the browsers that matters today.

In case you have not heard about it, EventSource (aka Server Sent Event) is a javascript api part of the html5 suite, which let you efficiently and asynchronously stream a large number of event messages accross a single HTTP connection.

We started to consider using EventSource in the context of a large scale realtime field monitoring system, where users may access web pages that let them vizualize evolution of datas coming from a large number of sensors. With EventSource we can very cleanly make web browsers be updated in realtime of events distributed by a publish/subscribe system like the one provided by Redis or RabbitMQ.

As we started experimenting with EventSource, we realized that it could not be used currently in Internet explorer 8, 9, 10, 11 and most of Android browsers. See this report for details.

We tested various polyfill aiming at widening the support of EventSource and after observing they were not allowing to support some of the browsers we had to target, we decided to build something on our own.

This project is now available on GitHub and we hope it will help raising awareness about this technology.