feat: support binding dev server to all network interfaces via --host#11
Closed
hackxixi wants to merge 2 commits into
Closed
feat: support binding dev server to all network interfaces via --host#11hackxixi wants to merge 2 commits into
hackxixi wants to merge 2 commits into
Conversation
- Pass PEAKCODE_HOST and VITE_WS_PORT through turbo globalEnv so child processes (Vite, server) receive the host configuration - Read PEAKCODE_HOST in vite.config.ts to bind Vite's dev server to the configured interface instead of always defaulting to localhost - Inject VITE_WS_PORT when binding to a wildcard address (0.0.0.0 / ::) so the browser can construct the correct WS URL from window.location.hostname + the server port, rather than a hardcoded loopback address - Fix wsTransport.ts fallback URL: was using window.location.port (Vite port 5733) instead of the WS server port (3773), breaking external connections - Add VITE_WS_URL and VITE_WS_PORT to ImportMetaEnv type declarations Usage: bun run dev -- --host 0.0.0.0 Claude-Session: https://claude.ai/code/session_01B95xcqmnLyWiAhApQdjtLC
- Update resolved package entries to use registry.npmmirror.com tarball URLs - Keep lockfile checksums and package metadata unchanged
Collaborator
|
感谢这个 PR @hackxixi,支持 但是这个 PR 目前没法合并,核心问题是 这个 PR 有 +1333/−1306 的改动,其中 1303 行删除全部来自 - "@anthropic-ai/claude-agent-sdk": [..., "", ...]
+ "@anthropic-ai/claude-agent-sdk": [..., "https://registry.npmmirror.com/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.2.112.tgz", ...]这会把贡献者本地的 npmmirror 镜像源固化进仓库,影响所有其他开发者的依赖解析,属于 lockfile drift,不能合入。 如果你愿意重新提交,建议这样做:
整理好之后欢迎再提,这个功能是有价值的 🙏 |
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.
Summary
PEAKCODE_HOSTandVITE_WS_PORTtoturbo.jsonglobalEnvso Turbo passes them through to Vite and the server processesPEAKCODE_HOSTinvite.config.tsto bind Vite's dev server to the configured interface (default:localhost)0.0.0.0/::), injectVITE_WS_PORTinstead of hardcoding[::1]intoVITE_WS_URL, so the browser constructs the WebSocket URL fromwindow.location.hostname+ the correct server portwsTransport.ts: fallback URL was usingwindow.location.port(Vite port 5733) instead of the WS server port (3773), breaking WebSocket connections when accessed from external hostsVITE_WS_URLandVITE_WS_PORTtoImportMetaEnvtype declarationsUsage
Test plan
bun run dev(no flags) still binds to localhost only — behaviour unchangedbun run dev -- --host 0.0.0.0binds both Vite (5733) and the WS server (3773) to0.0.0.0bun fmt && bun lint && bun run typecheckpasshttps://claude.ai/code/session_01B95xcqmnLyWiAhApQdjtLC