replace hard-wired websocket address

for ssh tunnels, we need to use the same adress as given in the
address bar, only changing port number to 8010
This commit is contained in:
2025-07-14 15:09:50 +02:00
parent 7e19a34d31
commit 1b9db884db

View File

@@ -238,8 +238,8 @@
output.scrollTop = output.scrollHeight; output.scrollTop = output.scrollHeight;
} }
function doConnect() { function doConnect(uri) {
websocket = new WebSocket("ws://linse-dil5:8010/"); websocket = new WebSocket(uri);
websocket.onopen = evt => onOpen(evt); websocket.onopen = evt => onOpen(evt);
websocket.onclose = evt => onClose(evt); websocket.onclose = evt => onClose(evt);
websocket.onmessage = evt => handleMSG(evt.data); websocket.onmessage = evt => handleMSG(evt.data);
@@ -300,7 +300,7 @@
} }
window.onload = function () { window.onload = function () {
doConnect(); doConnect('ws://' + window.location.hostname + ':8010/');
requestAnimationFrame(processUpdates); requestAnimationFrame(processUpdates);
} }
</script> </script>