feat: fully normalize CUSTOM_VITE_WS_URL (strip scheme/path, keep port)
Docker Build (ARM64) / Build & Push (push) Successful in 2m2s

This commit is contained in:
2026-06-24 20:59:17 +02:00
parent 7222c9ae63
commit a1db6e782d
+8 -3
View File
@@ -435,10 +435,15 @@ function App(): JSX.Element {
return
}
let wsUrl = import.meta.env.CUSTOM_VITE_WS_URL || 'wss://excalidraw.forkless.com'
if (wsUrl && !wsUrl.startsWith('ws://') && !wsUrl.startsWith('wss://')) {
wsUrl = 'wss://' + wsUrl
let rawUrl = import.meta.env.CUSTOM_VITE_WS_URL || 'wss://excalidraw.forkless.com'
try {
const parsed = new URL(rawUrl.startsWith('ws') ? rawUrl.replace(/^ws/, 'http') : rawUrl)
rawUrl = 'wss://' + parsed.host
} catch {
// Bare hostname/IP — prepend wss://
rawUrl = 'wss://' + rawUrl
}
const wsUrl = rawUrl
websocketRef.current = new WebSocket(wsUrl)