Sha256: 10854ebab3e1bf38a10b18cdebc55721e8710f7049bc7668d2bf4f9572272139
Contents?: true
Size: 702 Bytes
Versions: 22
Compression:
Stored size: 702 Bytes
Contents
<!doctype html> <html lang="en"> <head> <title>SSE Client</title> </head> <body> <h1>SSE Client</h1> <script> var connect = function () { console.log("connecting..."); var eventSource = new EventSource("/agent/sse/events"); eventSource.addEventListener('open', function(e) { console.log("connected"); document.querySelector('#status').innerText = 'connected'; return false; }, false); eventSource.addEventListener('message', function(e) { document.querySelector('#msg').innerText = e.data; }, false); }; window.onload = connect; </script> <h1 id="status">disconnected</h1> <h1 id="msg"></h1> </body> </html>
Version data entries
22 entries across 22 versions & 1 rubygems