Localhost proxy - manual test

Load this page through isolation, and run the companion endpoint server (localhost_proxy_test_server.py --help) on the machine running the thin client.

1. Loopback hostname (pre-existing behaviour)

2. Vanity hostname (needs localhost_vanity_hosts)

The host must resolve to loopback on this machine (hosts file) and be listed in the tenant's localhost_vanity_hosts internal config. The port must be in the tenant's local-communication policy.

3. WebSocket

Works for loopback hostnames (localhost, 127.0.0.1) and vanity hostnames, same requirements as above. Use ws:// or wss://. The endpoint should accept WebSocket upgrades on the given path; its replies are shown in the results log.

4. Request from an iframe

Creates a srcdoc iframe that runs the fetch itself. The result is posted back to this page and shown in the results log.

5. Request from an iframe with a separate doc

6. Early request (automatic)

No click needed. A script in <head> requests https://localhost:55920/hello as soon as the page starts to parse. This tests very early localhost requests. The result shows in the results log with an EARLY prefix.

7. Early vanity-host request (automatic)

Like test 6, but a second script in <head> requests https://lx.astxsvc.com:55920/hello. The result shows in the results log with an EARLY-VANITY prefix.

8. WebSocket message in a srcdoc iframe

Creates a srcdoc iframe that opens the WebSocket, sends the message and reports the reply back to this page.

9. HTML5 history navigation (same page)

Changes the address with history.pushState / replaceState (no page load), then fetches the url above. Back/Forward trigger popstate, which also re-runs the fetch. Use it to check the policy still applies after in-page navigation.

10. Early WebSocket (automatic)

No click needed. Scripts in <head> open wss://localhost:55920/ws and wss://lx.astxsvc.com:55920/ws as soon as the page starts to parse, send hello and close on the reply. Results show in the results log with EARLY-WS and EARLY-WS-VANITY prefixes.

11. Request from an about:blank iframe

Creates an iframe with src="about:blank", injects a script into its document, and runs the fetch from there. The result is posted back and shown with an ABOUT-BLANK prefix.

Results

A successful response echoes the Host header and TLS SNI the endpoint server saw - both should be the hostname you asked for, never 127.0.0.1.

(nothing yet)

Reading a failure

What you seeWhere it stopped
Network error (TypeError: Failed to fetch) Never tunnelled. The surrogate did not intercept it (host not in its vanity list - it needs a fresh pairing after a config change), or its port check denied it.
403, empty body Tunnelled, then the thin client refused the host: it is missing from the allowlist the thin client was served with. Reload the page after setting the internal config. To see what it got, check window.LOCALHOST_VANITY_HOSTS in devtools on the thin client's top-level document - this page runs in the isolated context and cannot read it.
504 after ~30s, empty body The per-port frame never became ready, usually because tc-server refused to render it. Look for event=tc-localhost-policy-violation in the tc-server log.
503, empty body The frame ran but its own connection to the endpoint failed: certificate not trusted, CORS refused, nothing listening, or - for an http:// vanity host on an https page - blocked as mixed content. The browser devtools console on the thin client shows which.
200 with the endpoint's JSON Whole path works.