Documentation
¶
Overview ¶
Package preview serves a session's checkout, and its artifact directory, over loopback HTTP, so the session's browser can load a local file without a file: URL. A file: page follows its own links to any path on the machine, and the Chromium that loads it runs outside a confined session's sandbox; it also gets a null origin, which blocks module scripts and fetch. Served from an os.Root, the directory is the whole of what the page can reach.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service holds one listener per served directory, opened the first time a page from it is asked for and kept until Close.
func (*Service) ArtifactURL ¶ added in v0.88.0
ArtifactURL is the http URL that serves raw when it names a file in dir, a session's artifact directory (internal/artifact), and ok is false when it does not, which leaves raw to the checkout. devPort is the session's dev-server port, 0 without one; it only places the listener.