fix ws url

This commit is contained in:
Matteo Rosati
2026-01-20 11:09:36 +01:00
parent 3dd38dc6fa
commit 3fabcaac07

View File

@@ -1,6 +1,8 @@
(($) => { (($) => {
const isSecure = location.protocol === "https:";
const port = location.port ? `:${location.port}` : "";
var ws = new WebSocket( var ws = new WebSocket(
`ws://${location.protocol + "//" + location.host}${location.port ? ":" + location.port : ""}/ws`, `ws${isSecure ? "s" : ""}://${location.host}${port}/ws`,
); );
const input = $("#message"); const input = $("#message");
const messages = $("#messages"); const messages = $("#messages");