XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

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
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +2 -1
Modified static/webui/script.js +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);