host

package
v0.16.154 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 20 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 host owns Chrome independently of the runtime's lifetime.

Index

Constants

View Source
const LogLimit = 4 << 20

LogLimit caps the persistent host log in bytes.

Variables

This section is empty.

Functions

func Main

func Main(args []string) error

Main parses the browser-host subcommand and handles termination signals.

func PrivateDir

func PrivateDir(dir string) error

PrivateDir creates an owner-only directory and rejects foreign ownership or symlinks.

func Run

func Run(ctx context.Context, cfg Config) error

Run owns a profile lock, relay, display and Chrome until termination.

func Running

func Running(dir string) bool

Running checks the host's advisory lock rather than trusting stale PID files.

func SocketPath

func SocketPath(runDir, profile string) string

SocketPath keeps room for the terminating NUL on both Linux and Darwin.

func Start

func Start(executable string, cfg Config) error

Start gives the host its own session; the runtime must only ever close its client socket.

func Stop

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

Stop gracefully closes only the browser behind this profile's private relay. Waiting for the host lock also waits for Chrome's final cookie/session writes.

Types

type Config

type Config struct {
	ProfileDir, Socket, Chrome, Mode string
	NoSandbox                        *bool
}

Config contains the paths and display mode for one profile host.

Jump to

Keyboard shortcuts

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