mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-04-11 21:33:04 +00:00
Use window location as base url for websocket url construction
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
96cd8fbe81
commit
cfab287200
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ export const useWebsocketUrl = (): URL => {
|
|||
return process.env.NEXT_PUBLIC_REALTIME_URL ?? LOCAL_FALLBACK_URL
|
||||
}
|
||||
try {
|
||||
const backendBaseUrlParsed = new URL(backendUrl)
|
||||
const backendBaseUrlParsed = new URL(backendUrl, window.location.toString())
|
||||
backendBaseUrlParsed.protocol = backendBaseUrlParsed.protocol === 'https:' ? 'wss:' : 'ws:'
|
||||
backendBaseUrlParsed.pathname += 'realtime'
|
||||
return backendBaseUrlParsed.toString()
|
||||
|
|
Loading…
Add table
Reference in a new issue