返回提交历史
Modified
static/webui/script.js
+2
-1
XFEstudio/XFESpaceNinjaServer
fix(webui): explicitly specify websocket protocol (#2578)
apparently some browsers (e.g. 2 year old chrome) need this to establish a connection. can't hurt, anyway. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2578 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
7e618539
代码差异
1 个文件
+2
-1
@@ -28,7 +28,8 @@ const sendAuth = isRegister => {
28
28
};
29
29
30
30
function openWebSocket() {
31
window.ws = new WebSocket("/custom/ws");
31
const wsProto = location.protocol === "https:" ? "wss://" : "ws://";
32
window.ws = new WebSocket(wsProto + location.host + "/custom/ws");
32
33
window.ws.onopen = () => {
33
34
ws_is_open = true;
34
35
sendAuth(false);