From 1ff3d9d1a6ed370e7830a142b726d45e9c7f5edf Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sat, 15 Nov 2025 23:10:32 +0100 Subject: [PATCH] Update Apache configuration and socket service for WebSocket support This commit adds a ProxyTimeout setting for WebSocket connections in the Apache configuration, enhancing the server's ability to manage long-lived connections. Additionally, the socket service documentation is updated to clarify compatibility with both Apache and Nginx as reverse proxies. These changes improve the handling of real-time communication in the application. --- apache.conf.example | 3 +++ backend/services/socketService.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apache.conf.example b/apache.conf.example index 889a683..5a0d286 100644 --- a/apache.conf.example +++ b/apache.conf.example @@ -49,6 +49,9 @@ RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Real-IP %{REMOTE_ADDR}s RequestHeader set X-Forwarded-For %{REMOTE_ADDR}s + + # Timeouts für WebSocket-Verbindungen + ProxyTimeout 3600 # API-Routen diff --git a/backend/services/socketService.js b/backend/services/socketService.js index 2c101e8..14c1882 100644 --- a/backend/services/socketService.js +++ b/backend/services/socketService.js @@ -9,7 +9,7 @@ export const initializeSocketIO = (httpServer) => { credentials: true, methods: ['GET', 'POST'] }, - // Wichtig für Reverse Proxy (Nginx): Path und Transports explizit setzen + // Wichtig für Reverse Proxy (Apache/Nginx): Path und Transports explizit setzen path: '/socket.io/', transports: ['websocket', 'polling'], // Erlaube Upgrade von polling zu websocket