From e6e63efb3f5182baa35e17f4598239574ae78b64 Mon Sep 17 00:00:00 2001 From: Maximilian Date: Thu, 1 Apr 2021 00:32:36 +0200 Subject: [PATCH] use window.location.hostname for now --- moodconsole/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moodconsole/src/App.tsx b/moodconsole/src/App.tsx index 61d8f5a..47ea6a4 100644 --- a/moodconsole/src/App.tsx +++ b/moodconsole/src/App.tsx @@ -69,7 +69,7 @@ function App() { useEffect(() => { if (socket === undefined) { - const websocket = new WebSocket("ws://127.0.0.1:6789/"); + const websocket = new WebSocket(`ws://${window.location.hostname}:6789/`); websocket.onmessage = (event) => { const data = JSON.parse(event.data); switch (data.type) {