feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#1571
feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#1571bj456736 wants to merge 1 commit 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 - 127.0.0.1 binding does not show LAN URLs
🦋 Changeset detectedLatest commit: 5d18d55 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: 5d18d55c37
ℹ️ 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".
| port: info.port, | ||
| host, | ||
| url: `http://${hostForUrl(host)}:${info.port}/`, | ||
| lanUrls: isAllInterfaces(host) ? getLocalNetworkAddresses(info.port) : undefined, |
There was a problem hiding this comment.
Include the auth token in advertised LAN links
When the server is bound to 0.0.0.0 or ::, resolveVisAuthToken requires VIS_AUTH_TOKEN for this non-loopback host, and the web client only sends the bearer header after it reads a token from ?token=/#token= or localStorage. The LAN URLs produced here are bare http://ip:port/ links, so a fresh phone/tablet browser that follows the newly advertised remote-control URL loads the shell but all /api calls return 401 unless the user manually edits in the token. Return/print tokenized LAN URLs when authToken is set, or otherwise include explicit token guidance with these links.
Useful? React with 👍 / 👎.
When vis-server binds to 0.0.0.0 or ::, automatically enumerate local network IPv4 addresses and display them in the startup banner and CLI output. This enables LAN-range remote control from phones, tablets, or other machines.