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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user