Repository navigation
feat(dev): use runtime-native server for dev listener - #4832
Merged
Merged
Conversation
Listen with `srvx` so Bun and Deno use their native servers. WebSocket upgrades on non-Node runtimes go through crossws proxy hooks, and `devProxy` falls back to httpxy `proxyFetch` when there is no Node.js request.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 6
✨ Finishing Touches
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. Comment |
commit: |
- merge target query, keep `//` paths, support IPv6 and TLS object targets - forward the client address in `x-forwarded-for` and only set basic auth when missing - reject worker websocket handshakes when the runner has no usable address - use crossws bun/deno adapters directly and load the websocket proxy on demand
pi0
approved these changes
Oct 18, 2026
This branch was successfully deployed
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.
Resolves #4816
The dev listener used
srvx/node, so under Bun and Deno it went through thenode:httpcompat layer. It now usessrvx, which picksBun.serve()/Deno.serve().Node.js: no behavior change. Upgrades still go through raw socket proxying (
upgrade()/proxyUpgrade()), anddevProxystill uses the full httpxy proxy server.Other runtimes:
resolveWebSocketHooks(req)returnscreateWebSocketProxyhooks for a matchingdevProxyrule or for the dev worker address (TCP orws+unix://). Client headers such as cookies are forwarded.devProxyHTTP falls back to httpxyproxyFetchwhen there is no Node.js request. This also makesnitro.fetch()work fordevProxyroutes.fetchplusresolveWebSocketHooks(req)is now a runtime-agnostic surface. That should make other hosts easier later, such as a browser dev server. env-runner itself still relies on Node.js APIs.Trade-offs on Bun/Deno
1011, not as an HTTP status.devProxyoptions apply (documented indocs/3.config).miniflarerunner (Cloudflare presets) are rejected with a503and a hint to use Node.js, because the runner reports no address to dial.Tests
test/unit/dev-proxy-web.test.tscovers theproxyFetchfallback and the crossws WebSocket proxy.nitro dev (bun)case intest/vite/websocket.test.tsnow runs on the native path.devProxyHTTP and WebSocket, and worker WebSocket.🤖 Generated with AI assistant