feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#1134
feat(vis): show LAN URLs when binding to 0.0.0.0 for remote control#1134bj456736 wants to merge 1 commit into
Conversation
|
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b46afed1d6
ℹ️ 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".
| for (const [, ifaceList] of Object.entries(os.networkInterfaces())) { | ||
| for (const iface of ifaceList ?? []) { | ||
| if (!iface.internal && iface.family === 'IPv4') { | ||
| addresses.push(`http://${iface.address}:${port}/`); |
There was a problem hiding this comment.
Include auth tokens in printed LAN URLs
For any --host 0.0.0.0/VIS_HOST=0.0.0.0 non-loopback launch, resolveVisAuthToken() requires auth and the web client only learns that token from ?token/#token or localStorage (apps/vis/web/src/api.ts). These newly printed LAN URLs are bare origins, so a phone or other fresh browser can load the shell but every /api/* call is rejected with 401 by the bearer middleware; include the token fragment or another auth handoff when authToken is set.
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: - 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
b46afed to
251148d
Compare
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()toconfig.tslanUrlsfield toStartedVisServerinstart.tsformatStartupBanner()to list LAN URLs when applicablevisCLI handler to print LAN access URLsTested
0.0.0.0binding shows LAN URL (e.g.http://10.210.62.129:3001/)127.0.0.1binding does not show LAN URLs (no regression)Example output: