Skip to content

fix: support explicit hosted browser origins - #3149

Open
dr0uleau wants to merge 3 commits into
mainfrom
drouleau/hosted-browser-origin
Open

dr0uleau wants to merge 3 commits into
mainfrom
drouleau/hosted-browser-origin

Conversation

@dr0uleau

@dr0uleau dr0uleau commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Why

A browser preview behind an HTTPS proxy sends its HTTPS Origin to the loopback broker. The broker needs an explicit origin setting to serve that preview.

What

Add the optional browserOrigin setting to relayBrokerPlugin. It accepts one HTTPS origin from trusted server configuration. The setting is an explicit opt-in and requires the Vite server in development mode.

How

The broker retains its loopback listener, loopback Host check, and same-origin request checks. The setting does not authenticate remote clients. The proxy must provide authentication. The default remains the HTTP loopback origin.

Risk

This affects the development broker only when the setting is present. Builds, production mode, and other modes reject the setting before identity access. An incorrect value prevents startup or blocks requests. Native and release hosts do not use it.

Testing

The regression checks exercise a real Vite loopback server with a disposable identity. They cover an accepted HTTPS request, an accepted POST, and refusal of other origins, cross-site requests, missing POST Origin, and a non-loopback Host. Vite config checks reject the option for production serve and development/production builds. The existing loopback checks also pass.

The author opens the hosted simulated preview on the laptop at 2419dcce and confirms it works. The later guard only rejects other configurations. The same development flow passes agent checks at 18d9720e. Independent review covers that final revision and reports no findings.

buzz-review-completed

Generated with Codex

dr0uleau and others added 3 commits November 9, 2026 15:05
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
@dr0uleau
dr0uleau marked this pull request as ready for review November 9, 2026 23:37
@dr0uleau
dr0uleau requested a review from a team as a code owner November 9, 2026 23:37
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