Repository navigation
feat(cloudflare): federate Vite Workers through the local edge - #3778
Open
RedPhortex wants to merge 1 commit into
Open
RedPhortex wants to merge 1 commit into
RedPhortex wants to merge 1 commit into
Conversation
Vite Workers now take part in the local zone-route router under `alchemy dev`. - Bridge each Vite dev server to the edge with `registerHttpServer()` under `<name>-vite-edge`, mapped with `LocalEdge.setTarget` - Keep a private origin proxy apart from the public proxy so routed requests cannot loop back through the public URL - Park requests on the origin while the dev server restarts - Add the domain and literal/`*.` route hosts to Vite's `allowedHosts` - Fail routed requests clearly when the dev server serves HTTPS Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vite Workers now join the local zone-route router under
alchemy dev: a Vite site with adomainandroutesserves matched paths from the owning Worker and everything else, including assets and HMR WebSockets, from its dev server.registerHttpServer()as<name>-vite-edgeand mapped withLocalEdge.setTarget. The public proxy stays separate, so a routed request cannot loop back through the public URL.domainand literal route hosts (.example.comfor*.example.com) are added to Vite'sallowedHosts.server.https, and the Worker's own dev URL keeps serving.devMode: "server") keep their proxy pointed straight at the dev server.Known limits, documented on
Website.Vite: Vite's host check rejects suffix wildcards (*example.com), a bare*host, and standaloneWorkers.WorkerRoutehostnames unless the app adds them toserver.allowedHosts.🤖 Generated with Claude Code