Bug: WebSocket-URL hat hardcoded Port 8000 #36

Open
opened 2026-03-30 19:54:13 +00:00 by David · 0 comments
Collaborator

Beschreibung

Die WebSocket-URL im Frontend Dashboard ist auf Port 8000 hardcoded. Bei jedem Non-Standard-Deployment (anderer Port, Reverse Proxy) schlägt die WebSocket-Verbindung fehl.

Hintergrund

Dashboard.tsx:45 konstruiert die WebSocket-URL als ws://${window.location.hostname}:8000/ws/updates. Das funktioniert nur wenn das Backend auf exakt Port 8000 läuft und kein Reverse Proxy davor steht.

Akzeptanzkriterien

  • WebSocket-URL wird dynamisch aus window.location abgeleitet (Port + Protokoll)
  • Funktioniert hinter Reverse Proxy (wss:// bei HTTPS)
  • Fallback/Konfiguration über Umgebungsvariable möglich (VITE_WS_URL)

Technische Hinweise

  • Fix in: frontend/src/pages/Dashboard.tsx:45
  • Lösung: const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; const wsUrl = \${wsProtocol}//${window.location.host}/ws/updates``
  • Oder über frontend/src/api/client.ts als zentrale Config
  • Migration nötig: nein

Aufwand: S

## Beschreibung Die WebSocket-URL im Frontend Dashboard ist auf Port 8000 hardcoded. Bei jedem Non-Standard-Deployment (anderer Port, Reverse Proxy) schlägt die WebSocket-Verbindung fehl. ## Hintergrund `Dashboard.tsx:45` konstruiert die WebSocket-URL als `ws://${window.location.hostname}:8000/ws/updates`. Das funktioniert nur wenn das Backend auf exakt Port 8000 läuft und kein Reverse Proxy davor steht. ## Akzeptanzkriterien - [ ] WebSocket-URL wird dynamisch aus `window.location` abgeleitet (Port + Protokoll) - [ ] Funktioniert hinter Reverse Proxy (wss:// bei HTTPS) - [ ] Fallback/Konfiguration über Umgebungsvariable möglich (`VITE_WS_URL`) ## Technische Hinweise - Fix in: `frontend/src/pages/Dashboard.tsx:45` - Lösung: `const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; const wsUrl = \`${wsProtocol}//${window.location.host}/ws/updates\`` - Oder über `frontend/src/api/client.ts` als zentrale Config - Migration nötig: nein ## Aufwand: S
Sign in to join this conversation.
No description provided.