Skip to content

fix: preserve the page port in WebSocket URLs - #25

Merged
kubbot merged 1 commit into
mainfrom
codex/fix-websocket-page-port-20261022
Oct 23, 2026
Merged

kubbot merged 1 commit into
mainfrom
codex/fix-websocket-page-port-20261022

Conversation

@kubbot

@kubbot kubbot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

The embedded browser page builds its WebSocket URL with location.hostname, which omits an explicit port. Opening the documented local server at http://localhost:18080 therefore tries ws://localhost/ws instead of the same server port.

Use location.host in both HTTP and HTTPS branches. This two-line change preserves the current page's port, including IPv6 hosts, while retaining the existing /ws path.

Validation: six offline cases execute the actual HTML inline configuration. The original fails four cases; the patch and an independently applied patch copy both pass all six (HTTP/HTTPS, explicit/default ports, IPv4/IPv6). Source blob and branch SHA verified before publication.

Scope: URL compatibility only. No Go build, actual browser/microphone, provider calls or end-to-end service validation was possible. The broader repository review remains explicitly limited; this draft does not establish a full or security audit pass.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d136e3c7-affc-4ee6-936a-b5879a0d1b2e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kubbot
kubbot marked this pull request as ready for review October 23, 2026 03:36
@kubbot
kubbot requested a review from cubxxw as a code owner October 23, 2026 03:36
@kubbot
kubbot merged commit 7ea61d9 into main Oct 23, 2026
7 of 14 checks passed
@qodo-code-review

qodo-code-review Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Preserve the page port in WebSocket URLs

🐞 Bug fix 🕐 Less than 5 minutes

Grey Divider

AI Description

• Build WebSocket URLs from the page host so explicit ports are retained.
• Preserve HTTPS-to-WSS selection and the existing /ws path.
Diagram

graph TD
  Page["Browser page"] --> Scheme{"HTTPS page?"} --> Secure["wss page host"] --> Server["WebSocket endpoint"]
  Scheme --> Plain["ws page host"] --> Server
Loading
High-Level Assessment

Using location.host is the smallest appropriate fix: it retains the page’s explicit port and IPv6 host formatting without changing scheme selection or the endpoint path.

Files changed (1) +2 / -2

Bug fix (1) +2 / -2
index.htmlRetain the page port in both WebSocket URL branches +2/-2

Retain the page port in both WebSocket URL branches

• Replaces location.hostname with location.host for both WS and WSS URLs. This keeps an explicit page port in the connection URL while leaving the '/ws' path unchanged.

cmd/voiceflow/web/index.html

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