desktop

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 6 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

Package desktop gives a target a private graphical display the operator can watch from a browser.

A tool that drives a real browser — a recorded replay, a test in headed mode, an agent clicking through a page — has nowhere to draw on a headless server, and what it would draw is exactly what the operator wants to see. This starts a virtual display with a VNC server and a noVNC web client on the target, all bound to the target's loopback. The control plane reaches the web client with a port forward, so nothing new listens on the target's network.

A browser running inside that display sees the target's own localhost, which is also the simplest way to use a web app that only listens there.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenBrowser

func OpenBrowser(ctx context.Context, run Runner, d *Desktop, address string) (string, error)

OpenBrowser starts a browser inside the desktop at address and names the one it found. A target with no browser still has a working desktop: a tool that brings its own, as Playwright does, only needs DISPLAY.

func Stop

func Stop(ctx context.Context, run Runner, dir string) error

Stop ends a desktop and everything started inside it, and removes its state.

Types

type Desktop

type Desktop struct {
	Dir     string // private state on the target: pids, logs, the browser profile
	Display int    // the X display number: tools run with DISPLAY=:<Display>
	Port    int    // the noVNC web client, on the target's loopback
	Width   int
	Height  int
}

Desktop is one running display.

func Start

func Start(ctx context.Context, run Runner, owner string, width, height int) (*Desktop, error)

Start brings up a display of the given size. owner identifies this server process, so a later server can tell its own desktops from abandoned ones.

type MissingError

type MissingError struct{ Tools []string }

MissingError names what the target needs installed before it can do this.

func (*MissingError) Error

func (e *MissingError) Error() string

type Runner

type Runner func(ctx context.Context, script string) (string, error)

Runner executes a shell script on one target and returns its stdout.

Jump to

Keyboard shortcuts

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