GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — fix(preview): resolve dev-server ports against the environment by patroza · Pull Request #115 · patroza/t3code Conversation
Owner
The bugOpening a dev server from a remote client shows
The failure surfaced as a browser error page, indistinguishable from a broken app. Agents driving This is upstream, not fork-local. The fixReachability is resolved by the environment, the only side that knows what is listening locally and what the tailnet routes. A new
When none apply it fails with Navigation, the discovered-port list, chat links, and agent Two loopback-family bugs found while verifyingVite's default VerificationFocused tests (357 passing across the touched scope), local typecheck for every touched package, and Verified against real tailscale on a live dev stack, not just mocks:
Notes for review
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsOpening a dev server from a remote client showed ERR_CONNECTION_REFUSED. The client rewrote `localhost:PORT` to the environment's hostname, kept the port and scheme, and navigated. That address only works if the port is independently published there, which it usually is not — dev servers bind loopback. The failure surfaced as a browser error page, indistinguishable from a broken app, so agents reported it as one. Reachability is now resolved by the environment, which is the only side that knows what is listening and what the tailnet routes. A new `preview.resolvePort` RPC answers with a URL it has verified: - a same-machine client keeps plain localhost; - an existing `tailscale serve` route is reused, at whatever port and scheme it was published under; - a port already answering on the environment's own address (WSL, LAN, a tunnel) uses that address and publishes nothing; - otherwise a tailnet-only HTTPS route is published, probed until it answers, and withdrawn when the dev server exits or the server shuts down. When none of those work it fails with a reason and a next action instead of a URL that cannot load. Navigation, the port list, chat links, and agent `preview_navigate`/`preview_open` all route through it; the old synchronous rewrite is kept for labels only. Two loopback-family bugs fell out of verifying this end to end. Vite's default `--host localhost` binds `::1` only, so `tailscale serve` mappings pinned to `127.0.0.1` proxy to nothing and answer 502 — `vp run dev --share` produced a URL that never worked. Both the new resolver and dev-share now target `localhost` and let tailscale pick the family. Upstream, not fork-local: both halves came from merged upstream PRs (pingdotgg#4011 rewrote the URL, pingdotgg#4556 added sharing) and the seam between them was never covered. Promote after merge.
patroza
force-pushed
the
fix/preview-remote-port-reachability
branch
from
4171df5 to
bd3059d
Compare
Uh oh!
There was an error while loading. Please reload this page.
patroza
added a commit
that referenced
this pull request
Opening a dev server from a remote client showed ERR_CONNECTION_REFUSED. The client rewrote `localhost:PORT` to the environment's hostname, kept the port and scheme, and navigated. That address only works if the port is independently published there, which it usually is not — dev servers bind loopback. The failure surfaced as a browser error page, indistinguishable from a broken app, so agents reported it as one. Reachability is now resolved by the environment, which is the only side that knows what is listening and what the tailnet routes. A new `preview.resolvePort` RPC answers with a URL it has verified: - a same-machine client keeps plain localhost; - an existing `tailscale serve` route is reused, at whatever port and scheme it was published under; - a port already answering on the environment's own address (WSL, LAN, a tunnel) uses that address and publishes nothing; - otherwise a tailnet-only HTTPS route is published, probed until it answers, and withdrawn when the dev server exits or the server shuts down. When none of those work it fails with a reason and a next action instead of a URL that cannot load. Navigation, the port list, chat links, and agent `preview_navigate`/`preview_open` all route through it; the old synchronous rewrite is kept for labels only. Two loopback-family bugs fell out of verifying this end to end. Vite's default `--host localhost` binds `::1` only, so `tailscale serve` mappings pinned to `127.0.0.1` proxy to nothing and answer 502 — `vp run dev --share` produced a URL that never worked. Both the new resolver and dev-share now target `localhost` and let tailscale pick the family. Upstream, not fork-local: both halves came from merged upstream PRs (pingdotgg#4011 rewrote the URL, pingdotgg#4556 added sharing) and the seam between them was never covered. Promote after merge.
patroza
added a commit
that referenced
this pull request
Opening a dev server from a remote client showed ERR_CONNECTION_REFUSED. The client rewrote `localhost:PORT` to the environment's hostname, kept the port and scheme, and navigated. That address only works if the port is independently published there, which it usually is not — dev servers bind loopback. The failure surfaced as a browser error page, indistinguishable from a broken app, so agents reported it as one. Reachability is now resolved by the environment, which is the only side that knows what is listening and what the tailnet routes. A new `preview.resolvePort` RPC answers with a URL it has verified: - a same-machine client keeps plain localhost; - an existing `tailscale serve` route is reused, at whatever port and scheme it was published under; - a port already answering on the environment's own address (WSL, LAN, a tunnel) uses that address and publishes nothing; - otherwise a tailnet-only HTTPS route is published, probed until it answers, and withdrawn when the dev server exits or the server shuts down. When none of those work it fails with a reason and a next action instead of a URL that cannot load. Navigation, the port list, chat links, and agent `preview_navigate`/`preview_open` all route through it; the old synchronous rewrite is kept for labels only. Two loopback-family bugs fell out of verifying this end to end. Vite's default `--host localhost` binds `::1` only, so `tailscale serve` mappings pinned to `127.0.0.1` proxy to nothing and answer 502 — `vp run dev --share` produced a URL that never worked. Both the new resolver and dev-share now target `localhost` and let tailscale pick the family. Upstream, not fork-local: both halves came from merged upstream PRs (pingdotgg#4011 rewrote the URL, pingdotgg#4556 added sharing) and the seam between them was never covered. Promote after merge.
patroza
added a commit
that referenced
this pull request
Opening a dev server from a remote client showed ERR_CONNECTION_REFUSED. The client rewrote `localhost:PORT` to the environment's hostname, kept the port and scheme, and navigated. That address only works if the port is independently published there, which it usually is not — dev servers bind loopback. The failure surfaced as a browser error page, indistinguishable from a broken app, so agents reported it as one. Reachability is now resolved by the environment, which is the only side that knows what is listening and what the tailnet routes. A new `preview.resolvePort` RPC answers with a URL it has verified: - a same-machine client keeps plain localhost; - an existing `tailscale serve` route is reused, at whatever port and scheme it was published under; - a port already answering on the environment's own address (WSL, LAN, a tunnel) uses that address and publishes nothing; - otherwise a tailnet-only HTTPS route is published, probed until it answers, and withdrawn when the dev server exits or the server shuts down. When none of those work it fails with a reason and a next action instead of a URL that cannot load. Navigation, the port list, chat links, and agent `preview_navigate`/`preview_open` all route through it; the old synchronous rewrite is kept for labels only. Two loopback-family bugs fell out of verifying this end to end. Vite's default `--host localhost` binds `::1` only, so `tailscale serve` mappings pinned to `127.0.0.1` proxy to nothing and answer 502 — `vp run dev --share` produced a URL that never worked. Both the new resolver and dev-share now target `localhost` and let tailscale pick the family. Upstream, not fork-local: both halves came from merged upstream PRs (pingdotgg#4011 rewrote the URL, pingdotgg#4556 added sharing) and the seam between them was never covered. Promote after merge.
patroza
added a commit
that referenced
this pull request
Opening a dev server from a remote client showed ERR_CONNECTION_REFUSED. The client rewrote `localhost:PORT` to the environment's hostname, kept the port and scheme, and navigated. That address only works if the port is independently published there, which it usually is not — dev servers bind loopback. The failure surfaced as a browser error page, indistinguishable from a broken app, so agents reported it as one. Reachability is now resolved by the environment, which is the only side that knows what is listening and what the tailnet routes. A new `preview.resolvePort` RPC answers with a URL it has verified: - a same-machine client keeps plain localhost; - an existing `tailscale serve` route is reused, at whatever port and scheme it was published under; - a port already answering on the environment's own address (WSL, LAN, a tunnel) uses that address and publishes nothing; - otherwise a tailnet-only HTTPS route is published, probed until it answers, and withdrawn when the dev server exits or the server shuts down. When none of those work it fails with a reason and a next action instead of a URL that cannot load. Navigation, the port list, chat links, and agent `preview_navigate`/`preview_open` all route through it; the old synchronous rewrite is kept for labels only. Two loopback-family bugs fell out of verifying this end to end. Vite's default `--host localhost` binds `::1` only, so `tailscale serve` mappings pinned to `127.0.0.1` proxy to nothing and answer 502 — `vp run dev --share` produced a URL that never worked. Both the new resolver and dev-share now target `localhost` and let tailscale pick the family. Upstream, not fork-local: both halves came from merged upstream PRs (pingdotgg#4011 rewrote the URL, pingdotgg#4556 added sharing) and the seam between them was never covered. Promote after merge.
patroza
added a commit
that referenced
this pull request
Opening a dev server from a remote client showed ERR_CONNECTION_REFUSED. The client rewrote `localhost:PORT` to the environment's hostname, kept the port and scheme, and navigated. That address only works if the port is independently published there, which it usually is not — dev servers bind loopback. The failure surfaced as a browser error page, indistinguishable from a broken app, so agents reported it as one. Reachability is now resolved by the environment, which is the only side that knows what is listening and what the tailnet routes. A new `preview.resolvePort` RPC answers with a URL it has verified: - a same-machine client keeps plain localhost; - an existing `tailscale serve` route is reused, at whatever port and scheme it was published under; - a port already answering on the environment's own address (WSL, LAN, a tunnel) uses that address and publishes nothing; - otherwise a tailnet-only HTTPS route is published, probed until it answers, and withdrawn when the dev server exits or the server shuts down. When none of those work it fails with a reason and a next action instead of a URL that cannot load. Navigation, the port list, chat links, and agent `preview_navigate`/`preview_open` all route through it; the old synchronous rewrite is kept for labels only. Two loopback-family bugs fell out of verifying this end to end. Vite's default `--host localhost` binds `::1` only, so `tailscale serve` mappings pinned to `127.0.0.1` proxy to nothing and answer 502 — `vp run dev --share` produced a URL that never worked. Both the new resolver and dev-share now target `localhost` and let tailscale pick the family. Upstream, not fork-local: both halves came from merged upstream PRs (pingdotgg#4011 rewrote the URL, pingdotgg#4556 added sharing) and the seam between them was never covered. Promote after merge.
patroza
added a commit
that referenced
this pull request
Opening a dev server from a remote client showed ERR_CONNECTION_REFUSED. The client rewrote `localhost:PORT` to the environment's hostname, kept the port and scheme, and navigated. That address only works if the port is independently published there, which it usually is not — dev servers bind loopback. The failure surfaced as a browser error page, indistinguishable from a broken app, so agents reported it as one. Reachability is now resolved by the environment, which is the only side that knows what is listening and what the tailnet routes. A new `preview.resolvePort` RPC answers with a URL it has verified: - a same-machine client keeps plain localhost; - an existing `tailscale serve` route is reused, at whatever port and scheme it was published under; - a port already answering on the environment's own address (WSL, LAN, a tunnel) uses that address and publishes nothing; - otherwise a tailnet-only HTTPS route is published, probed until it answers, and withdrawn when the dev server exits or the server shuts down. When none of those work it fails with a reason and a next action instead of a URL that cannot load. Navigation, the port list, chat links, and agent `preview_navigate`/`preview_open` all route through it; the old synchronous rewrite is kept for labels only. Two loopback-family bugs fell out of verifying this end to end. Vite's default `--host localhost` binds `::1` only, so `tailscale serve` mappings pinned to `127.0.0.1` proxy to nothing and answer 502 — `vp run dev --share` produced a URL that never worked. Both the new resolver and dev-share now target `localhost` and let tailscale pick the family. Upstream, not fork-local: both halves came from merged upstream PRs (pingdotgg#4011 rewrote the URL, pingdotgg#4556 added sharing) and the seam between them was never covered. Promote after merge.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | ||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |