var client = new EventSource("http://localhost:8080/stream/") client.onmessage = function (msg) { console.log(msg) }