From b6be0a20457bdc7aa4e3cce0de0d691f3a942b96 Mon Sep 17 00:00:00 2001 From: Mark de Bruijn Date: Mon, 19 Feb 2024 21:05:38 +0100 Subject: [PATCH] Fix: audio path is /audio not /audio/ --- index.js | 2 +- web/js/3las/3las.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 3e2d69f..abe3f79 100644 --- a/index.js +++ b/index.js @@ -446,7 +446,7 @@ httpServer.on('upgrade', (request, socket, head) => { wss.emit('connection', ws, request); }); }); - } else if (request.url === '/audio/') { + } else if (request.url === '/audio') { proxy.ws(request, socket, head); } else { socket.destroy(); diff --git a/web/js/3las/3las.js b/web/js/3las/3las.js index 92b79cb..53686a2 100644 --- a/web/js/3las/3las.js +++ b/web/js/3las/3las.js @@ -71,11 +71,11 @@ 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 + ':' + window.location.pathname + 'stream' + this.Settings.SocketPath, this.OnSocketError.bind(this), this.OnSocketConnect.bind(this), this.OnSocketDataReady.bind(this), this.OnSocketDisconnect.bind(this)); + if (window.location.protocol === 'https:') { + this.WebSocket = new WebSocketClient(this.Logger, 'wss://' + this.Settings.SocketHost + ':' + location.port.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() + this.Settings.SocketPath, 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 + ':' + location.port.toString() + window.location.pathname + 'audio' , 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.");