From f4da649aa55fa89527745d554c54c100774acd66 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 4 Sep 2025 14:52:19 +0200 Subject: [PATCH] Fix: Chat WebSocket auf Port 1235 umgestellt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- frontend/src/services/chatWs.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/services/chatWs.js b/frontend/src/services/chatWs.js index 6dac49a..344ca5d 100644 --- a/frontend/src/services/chatWs.js +++ b/frontend/src/services/chatWs.js @@ -20,8 +20,8 @@ export function getChatWsUrl() { if (host === 'localhost' || host === '127.0.0.1' || host === '::1' || host === '[::1]') { return `${proto}://127.0.0.1:1235`; } - // Default to same origin with socket.io path for production - const defaultUrl = `${proto}://${host}${port}/socket.io/`; + // Default to same origin with chat port for production + const defaultUrl = `${proto}://${host}:1235`; return defaultUrl; } @@ -50,12 +50,12 @@ export function getChatWsCandidates() { candidates.push(`${base}/`); } } - // Same-origin root and common WS paths - const sameOriginBases = [`${proto}://${host}${port}`]; - // If localhost-ish, also try 127.0.0.1 for same-origin port - if ((host === 'localhost' || host === '::1' || host === '[::1]') && port) { - sameOriginBases.push(`${proto}://[::1]${port}`); - sameOriginBases.push(`${proto}://127.0.0.1${port}`); + // Same-origin with chat port + const sameOriginBases = [`${proto}://${host}:1235`]; + // If localhost-ish, also try 127.0.0.1 for chat port + if (host === 'localhost' || host === '::1' || host === '[::1]') { + sameOriginBases.push(`${proto}://[::1]:1235`); + sameOriginBases.push(`${proto}://127.0.0.1:1235`); } for (const base of sameOriginBases) { candidates.push(base);