summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2022-03-06 14:16:00 +0100
committerstuebinm2022-03-06 14:16:00 +0100
commit80d6cadca15fdebb830e8b6006e38890ad0acbd9 (patch)
treed54a8a8b8d2c4f2098bc83e39099b213e394f45d
parent59396e56687db788480b97f60f754609f8592cca (diff)
server: don't hardcode the websocket domain/protocol
Diffstat (limited to '')
-rw-r--r--server/HtmlOrphans.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/HtmlOrphans.hs b/server/HtmlOrphans.hs
index b90ea6d..ee30773 100644
--- a/server/HtmlOrphans.hs
+++ b/server/HtmlOrphans.hs
@@ -75,7 +75,8 @@ instance ToHtml JobStatus where
p_ "you should probably ping an admin about this or sth"
where
autoReloadScript = script_
- "let ws = new WebSocket('ws://localhost:8080' + window.location.pathname + 'realtime');\n\
+ "let proto = window.location.protocol === 'https://' ? 'wss' : 'ws://';\
+ \let ws = new WebSocket(proto + window.location.host + window.location.pathname + 'realtime');\n\
\ws.onmessage = (event) => {\n\
\ let resp = JSON.parse(event.data);\n\
\ if (resp == 'RelintPending') {\n\