Skip to content

Instantly share code, notes, and snippets.

@oxtoacart
Created July 12, 2014 01:06
Show Gist options
  • Save oxtoacart/47de88d95c5ed0cc567e to your computer and use it in GitHub Desktop.
Save oxtoacart/47de88d95c5ed0cc567e to your computer and use it in GitHub Desktop.
<!-- This is a simple test of the stat server in flashlight -->
<html>
<head>
<script type="text/javascript">
var source = new EventSource('http://127.0.0.1:15670/');
source.addEventListener('message', function(e) {
console.log(e.data);
}, false);
source.addEventListener('open', function(e) {
console.log("Connection opened");
}, false);
source.addEventListener('error', function(e) {
if (e.readyState == EventSource.CLOSED) {
console.log("Connection closed");
}
}, false);
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment