Skip to content

Remove Gorilla WebSocket Intercept#1559

Open
cooper-grc wants to merge 2 commits intomainfrom
cg/harambe
Open

Remove Gorilla WebSocket Intercept#1559
cooper-grc wants to merge 2 commits intomainfrom
cg/harambe

Conversation

@cooper-grc
Copy link
Contributor

@cooper-grc cooper-grc commented Mar 20, 2026

Summary by cubic

Simplified the pod proxy by removing the custom Gorilla WebSocket intercept and routing all traffic through httputil.NewSingleHostReverseProxy. WebSocket and streaming are now handled by the standard reverse proxy with proper timeouts, immediate flushing, and 502 responses on backend errors.

  • Refactors
    • Removed Gorilla WebSocket upgrade/proxy flow; use httputil.NewSingleHostReverseProxy for HTTP and WebSocket.
    • Detect WebSocket upgrades to disable read deadlines; keep the standard read timeout for others.
    • Set FlushInterval = -1 for immediate flushing (SSE/streaming).
    • Added proxy.ErrorHandler to log and return 502 Bad Gateway on proxy errors.
    • Preserved connection options and Tailscale-aware dialing via custom DialContext.

Written for commit 610b641. Summary will update on new commits.

@cooper-grc cooper-grc marked this pull request as ready for review March 20, 2026 22:57
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="pkg/abstractions/pod/proxy.go">

<violation number="1" location="pkg/abstractions/pod/proxy.go:331">
P2: The custom proxy `ErrorHandler` logs errors but never returns an HTTP error response to the client.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant