LightCDP.Server (light_cdp v0.2.0)

Copy Markdown View Source

Manages the Lightpanda OS process via erlexec.

Starts the binary with serve mode, waits for the CDP server to be ready, and provides clean shutdown via SIGTERM.

Typically not used directly — LightCDP.start/1 handles this.

Binary path resolution

  1. start(binary: "/path/to/lightpanda")
  2. Application.get_env(:light_cdp, :lightpanda_path)
  3. ~/.local/bin/lightpanda

Summary

Functions

Starts a Lightpanda CDP server.

Stops a Lightpanda instance by sending SIGTERM to the OS process.

Functions

start(opts \\ [])

Starts a Lightpanda CDP server.

Returns {:ok, server, endpoint} where server is passed to stop/1 and endpoint is the HTTP base URL (e.g. "http://127.0.0.1:9222").

Options

  • :binary - path to the Lightpanda binary
  • :port - CDP server port (default: 9222)
  • :host - CDP server host (default: "127.0.0.1")
  • :timeout - Lightpanda inactivity timeout in seconds (default: 30)

stop(arg)

Stops a Lightpanda instance by sending SIGTERM to the OS process.