Skip to content

Instantly share code, notes, and snippets.

@syedjafer
Created September 6, 2022 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syedjafer/7f5231d9d1e45f32a11e37e8975ea2a1 to your computer and use it in GitHub Desktop.
Save syedjafer/7f5231d9d1e45f32a11e37e8975ea2a1 to your computer and use it in GitHub Desktop.
<html>
<head>
<script>
var source = new EventSource("http://localhost:5000/events");
source.addEventListener('dataUpdate', function(event) {
console.log(event);
}, false);
source.addEventListener('error', function(event) {
console.log("Error"+ event)
alert("Failed to connect to event stream. Is Redis running?");
}, false);
</script>
</head>
<body>
SSE TEST
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment