Skip to content

fix(ws): ticket auth + Firefox permessage-deflate fix#41

Merged
nicgen merged 3 commits into
mainfrom
fix/ws-ticket-auth
May 23, 2026
Merged

fix(ws): ticket auth + Firefox permessage-deflate fix#41
nicgen merged 3 commits into
mainfrom
fix/ws-ticket-auth

Conversation

@nicgen

@nicgen nicgen commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • WebSocket ticket pattern: one-time token (30s TTL, sync.Map) validates cross-domain WS connections when __Host- cookie is unavailable (Vercel frontend / VPS backend split)
  • CompressionDisabled on websocket.Accept: fixes Firefox 108s timeout caused by failed permessage-deflate negotiation with coder/websocket
  • NEXT_PUBLIC_WS_URL baked at build time via CD pipeline; frontend fallback maps komunumo.fr → api.komunumo.fr
  • Nginx: explicit /api/v1/ws location block with proxy_buffering off and 3600s timeouts

Test plan

  • Backend tests: go test ./... — all pass
  • Frontend tests: vitest run — 135/135 pass
  • TypeScript: tsc --noEmit — no errors
  • Manual Chrome: WS connected, messages send/receive OK
  • Manual Firefox: pending deploy with CompressionDisabled — was timing out before fix

nicgen added 3 commits May 23, 2026 20:01
Ticket pattern: one-time token (30s TTL, sync.Map) validates cross-domain
WS connections when __Host- cookie is unavailable (Vercel/VPS split).
CompressionDisabled: fixes Firefox WebSocket timeout caused by failed
permessage-deflate negotiation between browser and coder/websocket.
Fetches a one-time ticket before opening the WebSocket, enabling
cross-domain auth (komunumo.fr -> api.komunumo.fr). NEXT_PUBLIC_WS_URL
baked at build time via CD; fallback maps komunumo.fr -> api.komunumo.fr
for builds without the env var.
Dedicated /api/v1/ws location with proxy_buffering off and 3600s
timeouts for both HTTP and HTTPS server blocks, ensuring WebSocket
upgrade headers are not stripped by the generic location / block.
@nicgen nicgen merged commit f5267a7 into main May 23, 2026
11 checks passed
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