Inorder to support event streams in IE and other mobile browsers i'm attempting to use event-source-polyfill (https://www.npmjs.com/package/event-source-polyfill).
Can anyone please provide an example on how it could be used on a node service (or) it is just adding it via npm install and then we should be all set? From the documentation it looks like there are some server side requirements (https://www.npmjs.com/package/event-source-polyfill#server-side-requirements) out of which the,
- Last-Event-ID is a query parameter that needs to be sent in the api end point something like /api/eventstream?lastEventId=0
- 2 KB padding for IE which as mentioned in the example we can have this (response.write(":" + Array(2049).join(" ") + "\n");) on the node part
- You need to send "comment" messages each 15-30 seconds, these messages will be used as heartbeat to detect disconnects (what should be done for this one?)
So after npm install event-source-polyfill and then completing the steps from 1,2 and 3 it would eventually work in IE is that a fair understanding.