Closed fabien closed 9 years ago
Found it - I was using compress
middleware: https://github.com/expressjs/compression (see the note about Server-Sent Events)
Thanks for reporting and finding the solution, I'll add a note about this in the README.
Also, I might add an option to explicitly call flush after each write. That would probably be a Good Thing(tm).
Both would be great to have, yeah! Thanks!
Solved in 4f00f4f and released as 1.0.6. I didn't see any reason to use an option for this - it seemed like the reasonable thing to do, so it simply checks if the flush method exists on the response and calls it after a write. Thanks again for reporting.
I've trying to get sse-channel to work in an existing Express app, and it appears to work from my specs as well as plain
curl
usage. However, none of the browsers I tried (Chrome, Safari, FF) seem to work, after successfully connecting (open
).Something really strange is happening - the request stays pending in Chrome's network inspector, and then suddenly, after many minutes (up to 6 or so) some events come through. Then it stops again.
Is there anything I can check to resolve this issue? The response appears to be identical to your example and other sse scripts on the net.