From bb2b1d7fb1ecf07ca934a2d1b9dce3243c843a06 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 19 Dec 2025 14:51:52 +0000 Subject: [PATCH] fix: exclude WebSocket from rate limiting to prevent UI lockout The /ws endpoint was rate limited to 30 connections/minute. After prolonged use with WebSocket reconnections (network hiccups, browser tab throttling, etc.), users with many Docker containers would hit this limit and get stuck with a 'Connecting...' UI. WebSocket connections are already authenticated via session/API token and reconnections are normal behavior, so rate limiting is not needed. Fixes #859 (second report about WebSocket rate limiting after hours of use). --- internal/api/rate_limit_config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/api/rate_limit_config.go b/internal/api/rate_limit_config.go index 3aad91e..39ec819 100644 --- a/internal/api/rate_limit_config.go +++ b/internal/api/rate_limit_config.go @@ -136,6 +136,7 @@ func UniversalRateLimitMiddleware(next http.Handler) http.Handler { skipPaths := []string{ "/api/state", // Real-time state updates "/api/guests/metadata", // Guest metadata (polled frequently) + "/ws", // WebSocket connections (authenticated, reconnections are normal) } for _, path := range skipPaths { if strings.Contains(r.URL.Path, path) {