Skip to content

Commit

Permalink
Add backend url to connection error
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Müller <[email protected]>
  • Loading branch information
SystemKeeper committed Dec 10, 2023
1 parent 71ab6e5 commit 9726e01
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/signaling.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,10 @@ Signaling.Standalone.prototype.doSend = function(msg, callback) {
this.socket.send(JSON.stringify(msg))
}

Signaling.Standalone.prototype._getBackendUrl = function() {
return generateOcsUrl('apps/spreed/api/v3/signaling/backend')
}

Signaling.Standalone.prototype.sendHello = function() {
let msg
if (this.resumeId) {
Expand All @@ -1019,7 +1023,7 @@ Signaling.Standalone.prototype.sendHello = function() {
} else {
// Already reconnected with a new session.
this._forceReconnect = false
const url = generateOcsUrl('apps/spreed/api/v3/signaling/backend')
const url = this._getBackendUrl()
let helloVersion
if (this.hasFeature('hello-v2') && this.settings.helloAuthParams['2.0']) {
helloVersion = '2.0'
Expand Down Expand Up @@ -1073,7 +1077,8 @@ Signaling.Standalone.prototype.helloResponseReceived = function(data) {
}

// TODO(fancycode): How should this be handled better?
console.error('Could not connect to server', data)
const url = this._getBackendUrl()
console.error('Could not connect to server using backend url ' + url, data)
this.reconnect()
return
}
Expand Down

0 comments on commit 9726e01

Please sign in to comment.