Skip to content

feat: add NEXT_PUBLIC_LIVE_WS_PUBLIC_URL for custom domain WebSocket support - #5878

Merged
diegosouzapw merged 4 commits into
release/v3.8.43from
feat/live-ws-public-url-5877
Jul 2, 2026
Merged

diegosouzapw merged 4 commits into
release/v3.8.43from
feat/live-ws-public-url-5877

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Lands #5877 by @ianriizky with authorship preserved (the fork has maintainer edits disabled, so the pre-merge fixes could not be pushed to the original branch).

What

  • NEXT_PUBLIC_LIVE_WS_PUBLIC_URL so the live dashboard WebSocket client can connect via a custom domain (reverse proxy / Cloudflare Tunnel) instead of the hardcoded ws://hostname:20129.
  • Documents LIVE_WS_ALLOWED_HOSTS in .env.example and aligns the GitLab Duo OAuth scopes line with the live code (ai_features read_user).

Pre-merge fixes applied on top of the author's commits

  • Runtime resolution: NEXT_PUBLIC_* is inlined at build time, so prebuilt Docker/npm distributions would never see it. The /api/v1/ws?handshake=1 response now exposes publicUrl (computed lazily at request time) and useLiveDashboard consumes it before connecting — precedence: explicit wsUrl → build-time env → handshake → default.
  • Scheme validation (ws:///wss:// only) on both server and client.
  • Fixed the third test case (asserted a module-frozen const against an env set after import) and added scheme-validation cases.
  • CHANGELOG entry crediting @ianriizky.

Validation

  • tests/unit/live-ws-public-url.test.ts → 5/5 pass
  • Neighbors (v1-ws-route, v1-ws-bridge, live-ws-cookie-parse) → 10/10 pass
  • typecheck:core → only the 2 known pre-existing errors in open-sse/executors/base.ts (base-red)
  • ESLint on touched files → 0 errors

Closes #5877

ianriizky and others added 4 commits July 2, 2026 01:10
…ith scheme validation

- Read NEXT_PUBLIC_LIVE_WS_PUBLIC_URL lazily in /api/v1/ws (function, not
  module-level const) so runtime env changes are honored in prebuilt images.
- Only echo/consume publicUrl when it is a ws:// or wss:// URL (server and
  client guards); anything else is rejected to null.
- useLiveDashboard now fetches /api/v1/ws?handshake=1 before connecting and
  prefers: explicit wsUrl > build-time env > handshake publicUrl > default.
- Align GitLab Duo scopes line in .env.example with GITLAB_DUO_CONFIG.scope.
- Extend tests: lazy env read + scheme validation cases.
- CHANGELOG entry for 3.8.43.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@diegosouzapw
diegosouzapw merged commit 425324a into release/v3.8.43 Jul 2, 2026
2 of 3 checks passed
@diegosouzapw
diegosouzapw deleted the feat/live-ws-public-url-5877 branch July 3, 2026 04:58
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…support (cheaper-inference#5878)

* docs: add ai_features scope to GitLab Duo OAuth env setup instructions

* docs: add LIVE_WS_ALLOWED_HOSTS env var to example config for LAN/Tailscale setups

* feat: add web socket public URL for reverse proxy/Cloudflare Tunnel WebSocket setups

* fix(dashboard): resolve live WS public URL at runtime via handshake with scheme validation

- Read NEXT_PUBLIC_LIVE_WS_PUBLIC_URL lazily in /api/v1/ws (function, not
  module-level const) so runtime env changes are honored in prebuilt images.
- Only echo/consume publicUrl when it is a ws:// or wss:// URL (server and
  client guards); anything else is rejected to null.
- useLiveDashboard now fetches /api/v1/ws?handshake=1 before connecting and
  prefers: explicit wsUrl > build-time env > handshake publicUrl > default.
- Align GitLab Duo scopes line in .env.example with GITLAB_DUO_CONFIG.scope.
- Extend tests: lazy env read + scheme validation cases.
- CHANGELOG entry for 3.8.43.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>

---------

Co-authored-by: Septianata Rizky Pratama <ian.rizkypratama@gmail.com>
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.

2 participants