Skip to content

Instantly share code, notes, and snippets.

@amantix
Created October 4, 2017 16:23
Show Gist options
  • Save amantix/190ecbf676787b5c9549760957809fa0 to your computer and use it in GitHub Desktop.
Save amantix/190ecbf676787b5c9549760957809fa0 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="infoPane" />
<script>
var infoPane = document.getElementById('infoPane');
var report = function (msg) {
var info = document.createElement('p');
info.textContent = msg;
infoPane.appendChild(info);
}
var source = 'http://localhost:8080/';
var loader = new EventSource(source);
loader.onmessage = function (event) {
report(event.data);
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment