Documentation
¶
Overview ¶
Package web serves swampcy's desktop to a browser: a page and a signalling WebSocket behind `tailscale serve`, the screen as a WebRTC video track (AV1, or H.264 where the browser cannot decode AV1), and the viewer's pointer and keys back on a data channel (docs/web.md).
Index ¶
Constants ¶
const DefaultSingleSeatApps = `(?i)^(google-chrome|chrome|chromium|brave|microsoft-edge)`
DefaultSingleSeatApps matches the app IDs and X11 classes of Chromium-based browsers, and of Chrome's app windows (chrome-<url>-Default).
const LoginHeader = "Tailscale-User-Login"
LoginHeader is set by `tailscale serve` from the WireGuard peer, after removing any copy the client sent.
Variables ¶
This section is empty.
Functions ¶
func CheckListen ¶
CheckListen refuses any address but a loopback IP literal with a port: the server trusts LoginHeader, which only `tailscale serve` may set.
func TailnetIPv4 ¶
TailnetIPv4 returns this machine's Tailscale IPv4 address.
Types ¶
type Options ¶
type Options struct {
Login, Origin string
// UDP is where WebRTC media and data are received: host:port, or :port for the
// machine's Tailscale IPv4 address.
UDP string
// Codec is "auto" (AV1 when the browser offers it, else H.264), "av1" or "h264".
Codec string
FPS int
StartKbps int
MaxKbps int
Quality int // AV1's cq-level
Threads int
H264Profile string // "high" or "baseline"
// The agents' desktop is AgentOutput (empty for the top-left output), and the
// owner's OwnOutput (empty for none), sized to each viewer that asks for it.
// A viewer's input joins Seat (empty for the first) on either,
// except input to the windows of apps SingleSeatApps matches (by app ID or X11
// class), which joins the first seat, since they bind no other.
AgentOutput string
OwnOutput string
Seat string
SingleSeatApps *regexp.Regexp
Log *slog.Logger
}
Options configures the server.