From a402c45c9ca98f9e527094cec0ab1d52c8a5eba7 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sun, 5 Apr 2026 10:48:42 +0200 Subject: [PATCH] this one is not on me --- web/js/3las/3las.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/web/js/3las/3las.js b/web/js/3las/3las.js index 4409bf4..b9a347f 100644 --- a/web/js/3las/3las.js +++ b/web/js/3las/3las.js @@ -93,12 +93,9 @@ var _3LAS = /** @class */ (function () { if (this.WakeLock) this.WakeLock.Begin(); try { - if (window.location.protocol === 'https:') { - this.WebSocket = new WebSocketClient(this.Logger, 'wss://' + this.Settings.SocketHost + ':' + this.Settings.SocketPort.toString() + window.location.pathname + 'audio' , this.OnSocketError.bind(this), this.OnSocketConnect.bind(this), this.OnSocketDataReady.bind(this), this.OnSocketDisconnect.bind(this)); - } - else { - this.WebSocket = new WebSocketClient(this.Logger, 'ws://' + this.Settings.SocketHost + ':' + this.Settings.SocketPort.toString() + window.location.pathname + 'audio' , this.OnSocketError.bind(this), this.OnSocketConnect.bind(this), this.OnSocketDataReady.bind(this), this.OnSocketDisconnect.bind(this)); - } + const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:'; + const url = `${wsProtocol}//${location.hostname}/audio`; + this.WebSocket = new WebSocketClient(this.Logger, url , this.OnSocketError.bind(this), this.OnSocketConnect.bind(this), this.OnSocketDataReady.bind(this), this.OnSocketDisconnect.bind(this)); this.Logger.Log("Init of WebSocketClient succeeded"); this.Logger.Log("Trying to connect to server."); }