mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
fix: live base server url. (#5734)
* fix: live base server url. * chore: update websocket URL logic.
This commit is contained in:
@@ -115,11 +115,11 @@ export const PageEditorBody: React.FC<Props> = observer((props) => {
|
||||
const realtimeConfig: TRealtimeConfig | undefined = useMemo(() => {
|
||||
// Construct the WebSocket Collaboration URL
|
||||
try {
|
||||
const LIVE_SERVER_BASE_URL = LIVE_BASE_URL ?? window.location.origin;
|
||||
const WS_LIVE_URL = new URL(`${LIVE_SERVER_BASE_URL}${LIVE_BASE_PATH}`);
|
||||
const LIVE_SERVER_BASE_URL = LIVE_BASE_URL?.trim() || window.location.origin;
|
||||
const WS_LIVE_URL = new URL(LIVE_SERVER_BASE_URL);
|
||||
const isSecureEnvironment = window.location.protocol === "https:";
|
||||
WS_LIVE_URL.protocol = isSecureEnvironment ? "wss" : "ws";
|
||||
WS_LIVE_URL.pathname = "collaboration";
|
||||
WS_LIVE_URL.pathname = `${LIVE_BASE_PATH}/collaboration`;
|
||||
// Construct realtime config
|
||||
return {
|
||||
url: WS_LIVE_URL.toString(),
|
||||
|
||||
Reference in New Issue
Block a user