Implement session replacement and WebSocket keepalive features

Enhanced the session management by allowing a reconnect with the same username to replace the existing session, sending a logout message to the previous session. Introduced WebSocket keepalive functionality using Ping/Pong messages to detect stale connections. Updated documentation to reflect these changes and improve user experience during reconnections.
This commit is contained in:
Torsten Schulz (local)
2026-03-05 08:03:15 +01:00
parent 92ae7d614e
commit 8b9947cc03
5 changed files with 174 additions and 112 deletions

View File

@@ -11,7 +11,8 @@ Die Kommunikation erfolgt ueber WebSocket (Frontend) und optional TCP/Unix-Socke
- In-Memory-Room-Management
- Token-basierte Session-Absicherung pro Verbindung
- Username-Pruefung (3-32 Zeichen, `[a-zA-Z0-9_]`)
- Verhindert Mehrfach-Login mit identischem Namen (`loggedin`)
- Reconnect-freundlich: bestehende Session wird bei erneutem `init` mit gleichem Namen ersetzt
- WebSocket Keepalive via Ping/Pong zur Erkennung verwaister Verbindungen
- Optionale Allowlist fuer User via `CHAT_ALLOWED_USERS`
- Optionale DB-basierte User-Pruefung via Postgres (`CHAT_DB_URL`)
- Kompatible Antworttypen fuer die bestehende `chatTcpBridge.js`