Handle https when creating socket

This commit is contained in:
pythongosssss 2023-02-13 17:53:21 +00:00 committed by GitHub
parent 84ea70fa80
commit af03443f73

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;