Enhance socketService configuration for WebSocket upgrades

This commit updates the `socketService.js` file to improve WebSocket upgrade handling by adding two new configuration options: `allowEIO3`, which permits WebSocket upgrades without an Origin header, and `serveClient`, which disables serving the client bundle. These changes enhance compatibility with reverse proxies and optimize the WebSocket connection process.
This commit is contained in:
Torsten Schulz (local)
2025-11-16 00:05:45 +01:00
parent 22e9750e5d
commit f437747664

View File

@@ -18,7 +18,11 @@ export const initializeSocketIO = (httpServer) => {
upgradeTimeout: 10000,
// Ping-Timeout für Verbindungen
pingTimeout: 60000,
pingInterval: 25000
pingInterval: 25000,
// Wichtig für Reverse Proxy: Erlaube WebSocket-Upgrades auch ohne Origin-Header
allowEIO3: true,
// Erlaube WebSocket-Upgrades auch wenn der Request von einem Proxy kommt
serveClient: false
});
io.on('connection', (socket) => {