feat: implement one-port WebSocket server with updated connection handling and configuration

This commit is contained in:
MythEclipse
2026-05-13 17:49:33 +07:00
parent f9a4b4a92d
commit 0e056732bc
5 changed files with 188 additions and 19 deletions
+2 -1
View File
@@ -178,7 +178,8 @@
function initWebSocket() {
if (socket && (socket.readyState === WebSocket.OPEN || socket.readyState === WebSocket.CONNECTING)) return;
socket = new WebSocket(`ws://${window.location.hostname}:3001`);
const wsProtocol = window.location.protocol === "https:" ? "wss:" : "ws:";
socket = new WebSocket(`${wsProtocol}//${window.location.host}/ws`);
socket.binaryType = 'arraybuffer';
socket.onopen = () => {