Load this page through isolation, and run the companion endpoint
server (localhost_proxy_test_server.py --help) on the
machine running the thin client.
localhost_vanity_hosts)localhost_vanity_hosts internal
config. The port must be in the tenant's local-communication policy.
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.
srcdoc iframe that runs the fetch itself. The
result is posted back to this page and shown in the results log.
<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.
<head> requests
https://lx.astxsvc.com:55920/hello. The result shows in
the results log with an EARLY-VANITY prefix.
srcdoc iframe that opens the WebSocket, sends
the message and reports the reply back to this page.
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.
<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.
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.
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)
| What you see | Where 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. |