From 3e5ddd8a05fce483a79b055256c302923f04d2c8 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sat, 15 Nov 2025 23:59:00 +0100 Subject: [PATCH] Refine Apache configuration for WebSocket upgrade handling and clarify conditions This commit updates the Apache configuration to enhance the handling of WebSocket upgrades by specifying exact conditions for the Upgrade and Connection headers. It also clarifies the fallback mechanism for HTTP polling, ensuring better compatibility and reliability in real-time communication scenarios. --- apache.conf.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apache.conf.example b/apache.conf.example index c362e06..bb3e300 100644 --- a/apache.conf.example +++ b/apache.conf.example @@ -37,11 +37,11 @@ # WebSocket-Upgrade erkennen und weiterleiten (wss:// -> ws://) # Die RewriteRule wird nur ausgeführt, wenn Upgrade-Header vorhanden ist - # WICHTIG: Query-String muss erhalten bleiben (QSA Flag) + # Andernfalls wird ProxyPass verwendet (für HTTP-Polling) RewriteEngine on - RewriteCond %{HTTP:Upgrade} websocket [NC] - RewriteCond %{HTTP:Connection} upgrade [NC] + RewriteCond %{HTTP:Upgrade} =websocket [NC] + RewriteCond %{HTTP:Connection} =upgrade [NC] RewriteRule ^/socket\.io/?(.*) ws://localhost:3050/socket.io/$1 [P,L,QSA] # Fallback für HTTP-Polling (wird verwendet, wenn RewriteRule nicht greift)