mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 03:01:23 +01:00
22 lines
645 B
HTML
22 lines
645 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
<h1>Getting server updates</h1>
|
|
<div id="result"></div>
|
|
|
|
<script>
|
|
// Example taken from: https://www.w3schools.com/html/html5_serversentevents.asp
|
|
if (typeof EventSource !== "undefined") {
|
|
const source = new EventSource("/debug/sse");
|
|
source.onmessage = function (event) {
|
|
console.log(event);
|
|
document.getElementById("result").innerHTML += event.data + "<br>";
|
|
};
|
|
} else {
|
|
document.getElementById("result").innerHTML =
|
|
"Sorry, your browser does not support server-sent events...";
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|