proxy

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package proxy implements the reverse proxy that fronts the user's live local server in prereview's --external mode: it strips framing/CSP blockers from HTML navigations and injects a postMessage beacon so the prereview UI can iframe the page and track navigation, scroll, and annotation focus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExternalProxy

func NewExternalProxy(target *url.URL) http.Handler

NewExternalProxy builds the reverse proxy that fronts the user's live local server in `--external` mode. It runs on its OWN port (a separate origin from the prereview UI) so the app's root-relative URLs (`/api/…`, `/@vite/client`, its own websocket) resolve against the proxy root and forward cleanly with zero URL rewriting — the make-or-break property a same-origin path-prefix proxy can't provide. httputil.ReverseProxy upgrades websockets natively.

For HTML navigations it strips framing/CSP blockers (so the page can be iframed by the UI) and injects proxyBeaconJS before </body>.

Types

This section is empty.

Jump to

Keyboard shortcuts

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