Fixing websocket connection problem with new subpath feature
This commit is contained in:
parent
298141471c
commit
5dbc1d5a81
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ class OctoListener {
|
|||
reopenDelay = 3000
|
||||
|
||||
constructor(serverUrl?: string, token?: string, readToken?: string) {
|
||||
this.serverUrl = serverUrl || Utils.buildURL('', true)
|
||||
this.serverUrl = serverUrl || Utils.buildURL('', true).replace(/\/$/, '')
|
||||
this.token = token || localStorage.getItem('focalboardSessionId') || ''
|
||||
this.readToken = readToken || OctoListener.getReadToken()
|
||||
Utils.log(`OctoListener serverUrl: ${this.serverUrl}`)
|
||||
|
@ -66,7 +66,7 @@ class OctoListener {
|
|||
|
||||
const url = new URL(this.serverUrl)
|
||||
const protocol = (url.protocol === 'https:') ? 'wss:' : 'ws:'
|
||||
const wsServerUrl = `${protocol}//${url.host}${url.pathname}/ws/onchange`
|
||||
const wsServerUrl = `${protocol}//${url.host}${url.pathname}ws/onchange`
|
||||
Utils.log(`OctoListener open: ${wsServerUrl}`)
|
||||
const ws = new WebSocket(wsServerUrl)
|
||||
this.ws = ws
|
||||
|
|
Loading…
Reference in a new issue