Use relative link for ws on test page

This commit is contained in:
Lucas Schumacher 2023-11-01 02:09:28 -04:00
parent d27883bc97
commit 7a7a4b7fce

View File

@ -55,7 +55,7 @@ fn index() -> Html<&'static str> {
sendForm.hidden = false; sendForm.hidden = false;
msgsArea.hidden = false; msgsArea.hidden = false;
msgInput.focus(); msgInput.focus();
ws = new WebSocket("ws://localhost:2000/api/ws"); ws = new WebSocket("ws://" + window.location.host + "/api/ws");
ws.onmessage = function(event) { ws.onmessage = function(event) {
msgsArea.value += event.data + "\r\n"; msgsArea.value += event.data + "\r\n";
} }