Handle https when creating socket

This commit is contained in:
pythongosssss
2023-02-13 17:53:21 +00:00
committed by GitHub
parent c472377622
commit 540bbbdb82

View File

@@ -490,7 +490,7 @@ document.addEventListener('drop', (event) => {
if(ws) return;
let opened = false;
ws = new WebSocket(`ws://${location.host}/ws`);
ws = new WebSocket(`ws${window.location.protocol === "https"? "s" : ""}://${location.host}/ws`);
ws.addEventListener("open", () => {
opened = true;