feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#2103
feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#2103bj456736 wants to merge 2 commits into
Conversation
When vis-server binds to 0.0.0.0 or :: (all interfaces), the startup banner and CLI output now display the actual LAN IP addresses that other devices on the same network can use to connect. This enables lan-range remote control from phones, tablets, or other machines. Changes: - Add isAllInterfaces() and getLocalNetworkAddresses() to config.ts - Add lanUrls field to StartedVisServer in start.ts - Update formatStartupBanner() to list LAN URLs when applicable - Update vis CLI handler to print LAN access URLs Tested: - 0.0.0.0 binding shows LAN URL (e.g. http://10.210.62.129:3001/) - 127.0.0.1 binding does not show LAN URLs
🦋 Changeset detectedLatest commit: bf28c1b The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf28c1b804
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (options.lanUrls !== undefined && options.lanUrls.length > 0) { | ||
| banner += | ||
| `[vis-server] LAN access:\n` + | ||
| options.lanUrls.map((url) => ` - ${url}`).join('\n') + |
There was a problem hiding this comment.
Include the auth token in LAN links
When vis is bound to 0.0.0.0 or ::, the server normally has VIS_AUTH_TOKEN set because non-loopback binds are rejected without it; however these new LAN URLs are printed as bare origins. A browser on another device has no kimi-vis-auth-token in localStorage and the SPA only sends Authorization after it reads token/vis_token from the URL, so opening the advertised LAN link loads the shell but every /api/* request returns 401. Add the token fragment/query to these printed links, or otherwise print a usable authenticated URL.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,8 @@ | |||
| --- | |||
| "@moonshot-ai/kimi-server": patch | |||
There was a problem hiding this comment.
Point the changeset at an existing package
This changeset names @moonshot-ai/kimi-server, but there is no workspace package with that name in the repo; the changed CLI package is @moonshot-ai/kimi-code, while @moonshot-ai/vis-server is private and ignored by changesets. As written, the release workflow cannot apply the user-visible kimi vis changelog/bump to the published CLI package and may fail when processing the unknown package name.
Useful? React with 👍 / 👎.
When vis-server binds to 0.0.0.0 or :: (all interfaces), the startup banner and CLI output now display the actual LAN IP addresses that other devices on the same network can use to connect. This enables lan-range remote control from phones, tablets, or other machines.
Changes
isAllInterfaces()andgetLocalNetworkAddresses()to config.tslanUrlsfield to StartedVisServer in start.tsformatStartupBanner()to list LAN URLs when applicableTesting
Closes the "web:局域网范围的remote control" task.