fix bug when serving on a host or port different from default

This commit is contained in:
zyl 2025-01-14 10:41:01 -08:00
parent 4265317edd
commit 9608925572
Signed by: zyl
SSH key fingerprint: SHA256:uxxbSXbdroP/OnKBGnEDk5q7EKB2razvstC/KmzdXXs

View file

@ -6,7 +6,7 @@
let socket; let socket;
function start(reload) { function start(reload) {
socket = new WebSocket("ws://127.0.0.1:8080"); socket = new WebSocket(`ws://${location.host}`);
let reloading = false; let reloading = false;
socket.onmessage = function (ev) { socket.onmessage = function (ev) {
if (ev.data === "reload") { if (ev.data === "reload") {