Fix: Chat WebSocket auf Port 1235 umgestellt

Problem:
- Chat WebSocket versuchte wss://www.your-part.de (ohne Port)
- Sollte wss://www.your-part.de:1235 sein (direkte Verbindung)

Lösung:
- getChatWsUrl() verwendet jetzt Port 1235 für Production
- getChatWsCandidates() verwendet Port 1235 für alle Hosts
- Direkte Verbindung zum Chat-Server auf Port 1235

Chat-Server:
- Läuft mit SSL auf Port 1235
- yourchat.service: SSL WebSocket Server starting on port 1235
- Frontend: wss://www.your-part.de:1235 mit 'chat' Protokoll
This commit is contained in:
Torsten Schulz (local)
2025-09-04 14:52:19 +02:00
parent e5db389236
commit f4da649aa5

View File

@@ -20,8 +20,8 @@ export function getChatWsUrl() {
if (host === 'localhost' || host === '127.0.0.1' || host === '::1' || host === '[::1]') { if (host === 'localhost' || host === '127.0.0.1' || host === '::1' || host === '[::1]') {
return `${proto}://127.0.0.1:1235`; return `${proto}://127.0.0.1:1235`;
} }
// Default to same origin with socket.io path for production // Default to same origin with chat port for production
const defaultUrl = `${proto}://${host}${port}/socket.io/`; const defaultUrl = `${proto}://${host}:1235`;
return defaultUrl; return defaultUrl;
} }
@@ -50,12 +50,12 @@ export function getChatWsCandidates() {
candidates.push(`${base}/`); candidates.push(`${base}/`);
} }
} }
// Same-origin root and common WS paths // Same-origin with chat port
const sameOriginBases = [`${proto}://${host}${port}`]; const sameOriginBases = [`${proto}://${host}:1235`];
// If localhost-ish, also try 127.0.0.1 for same-origin port // If localhost-ish, also try 127.0.0.1 for chat port
if ((host === 'localhost' || host === '::1' || host === '[::1]') && port) { if (host === 'localhost' || host === '::1' || host === '[::1]') {
sameOriginBases.push(`${proto}://[::1]${port}`); sameOriginBases.push(`${proto}://[::1]:1235`);
sameOriginBases.push(`${proto}://127.0.0.1${port}`); sameOriginBases.push(`${proto}://127.0.0.1:1235`);
} }
for (const base of sameOriginBases) { for (const base of sameOriginBases) {
candidates.push(base); candidates.push(base);