previewfix

command
v0.209.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command previewfix is the previews browser spec's fixture (e2e/tests/previews.spec.ts): the two processes around the real gateway and the real host that the spec cannot be itself.

	previewfix edge -listen 127.0.0.1:<port> -upstream 127.0.0.1:<gateway public port> -log <file>
	previewfix app  -listen 127.0.0.1:<port>[,127.0.0.1:<port>…] -log <file>

  - edge: the TLS edge in front of the gateway's public listener, as the
    real deployment's edge is (the gateway speaks plain HTTP and leaves TLS
    to the edge). A self-signed certificate made at start for the spec's
    zone (the browser runs with ignoreHTTPSErrors), HTTP/1.1 only, and a
    reverse proxy that changes NOTHING the gateway reads: the Host, every
    Sec-Fetch-* header, Origin and the cookies pass as the browser sent
    them, and no X-Forwarded-* is added. It writes one JSON line per
    request — what the gateway was sent (the Sec-Fetch-* values, Origin,
    the NAMES of the cookies, never their values), the status the gateway
    answered (101 for an upgrade) and its refusal code, if any — so the spec reads the real
    browser's Fetch Metadata as the gateway saw it.
  - app: the "dev server" a mirrored window runs: on each loopback address
    it serves a page whose script opens a WebSocket echo (as a dev server's
    hot-reload socket does) and an EventSource, the echo and the event
    stream themselves, /api/ping, /secret (what a sibling preview must not
    reach), and /attack?victim=<url> (a page that loads <url> in a hidden
    iframe and opens a WebSocket to <url>'s host /ws: a sibling preview
    reaching for another). Every request is one
    JSON line in the log: which listener, the method and the path, so the
    spec sees what reached an app and what never did.

Every name and value here is invented for the suite; nothing is reached but loopback.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL