diff --git a/static/sse.js b/static/sse.js index 3f4c897..cac8ca8 100644 --- a/static/sse.js +++ b/static/sse.js @@ -1,4 +1,4 @@ -var url = "http://localhost:3000/sse"; +var url = "http://" + location.host + "/sse"; var es = new EventSource(url); es.addEventListener("open", function (e) { diff --git a/static/ws.js b/static/ws.js index 4f6a617..86906e6 100644 --- a/static/ws.js +++ b/static/ws.js @@ -1,4 +1,4 @@ -var url = "ws://localhost:3000/subscribe"; +var url = "ws://" + location.host + "/subscribe"; var ws = new WebSocket(url); ws.addEventListener("open", function (e) {