2014-05-13 21:51:16 +08:00
|
|
|
<html>
|
|
|
|
<head>
|
2014-05-30 00:04:28 +08:00
|
|
|
<title> proxy index </title>
|
2014-05-13 21:51:16 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
window.onload = function() {
|
|
|
|
var es = new EventSource("/api/sse");
|
|
|
|
var div = document.getElementById('events');
|
|
|
|
es.onmessage = function(ev) {
|
|
|
|
var el = document.createElement('div');
|
|
|
|
el.innerHTML = 'sse message: ' + ev.data;
|
|
|
|
div.appendChild(el);
|
|
|
|
// Keep only last 5 messages in the list
|
|
|
|
while (div.childNodes.length > 5) div.removeChild(div.firstChild);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2014-05-30 00:04:28 +08:00
|
|
|
<h1> proxy index page.</h1>
|
2014-05-13 21:51:16 +08:00
|
|
|
<ul>
|
|
|
|
<li><a href="app1">App1</a> - App1 root</li>
|
|
|
|
<li><a href="app2">App2</a> - App2 root</li>
|
|
|
|
</ul>
|
2014-05-30 00:04:28 +08:00
|
|
|
|
2014-05-13 21:51:16 +08:00
|
|
|
<h2>SSE pushes, done by separate threads at random times:</h2>
|
|
|
|
<div id="events"></div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|