Fix SSE architecture for reliable connections #13
Reference in New Issue
Block a user
Delete Branch "fix/sse-architecture"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Aligns the SSE/real-time architecture with portigo's working pattern to fix connection issues.
Changes
HandleGameEventsto create NATS subscriptions before SSE objectmiddleware.NewWrapResponseWriterfor properhttp.FlushersupportErrorLogto HTTP server for better error visibilityCookie.Secureto false for HTTP supportConnectionIndicatorpatching (was causingPatchElementsNoTargetsFound)Root Cause
The logging middleware was wrapping the ResponseWriter without implementing
http.Flusher, causing SSE data to be buffered instead of flushed immediately. This led to Cloudflare 524 timeouts.