diff --git a/template.js b/template.js index 9ed9b93..73ba5f8 100644 --- a/template.js +++ b/template.js @@ -57,7 +57,7 @@ const template = ` } const url = new URL(window.location) - url.protocol = "wss" + url.protocol = document.location.protocol === "http:" ? "ws://" : "wss://"; url.pathname = "/ws" websocket(url)