DebugConfig

Immutable configuration for the Lustro debug runtime.

A value object (deliberately not a data class, to keep the public surface stable and mirrorable by :lustro-noop). Build instances with builder or use DEFAULT. The dispatch/capture limits (maxConcurrentRequests, requestQueueCapacity, requestTimeoutMs, maxRequestBodyBytes, allowedOrigins, captureBudgetBytes) are enforced by the runtime.

Types

Link copied to clipboard
class Builder

Mutable builder for DebugConfig. Each setter returns this for chaining.

Link copied to clipboard
object Companion

Factories and the DEFAULT configuration.

Properties

Link copied to clipboard

Extra Origins permitted to call the debug API, on any method; the server's own origin is always allowed (other localhost ports are not). Default empty.

Link copied to clipboard

Whether Lustro.start may arm the server in a build that is not marked debuggable. Default false: in such a build start() logs a WARN and returns LustroStatus.DISABLED without binding a socket. Opt in only for builds that ship android:debuggable="false" yet are still internal (QA, dogfood); never for a build that reaches end users.

Link copied to clipboard

Base URL for the relative URLs of the Send form when the Network tab sends through a senderClient, or null. A sender from OkHttpSender.create has its own base URL instead. Default null.

Link copied to clipboard

The address to bind. Default "127.0.0.1", loopback. Any other address, such as "0.0.0.0", makes the server reachable from the network, where the token travels as plain HTTP. The server then makes a new token each time the app's process starts.

Link copied to clipboard

Whether to fall back to an ephemeral port when serverPort is taken. Default false: the server then tries serverPort again for 10 s while the app is in the foreground, and else does not start until the next foreground.

Link copied to clipboard

Total in-memory capture budget in bytes: the captured bodies the Network tab keeps, counted as kept. A body that isn't kept, such as a media download, costs nothing. Past the budget the oldest finished transactions go first. Default 50 MB.

Link copied to clipboard

Maximum bytes captured per request/response body, and per WebSocket message. Default 256 KB.

Link copied to clipboard

Maximum number of retained transactions (ring cap). Default 1000.

Link copied to clipboard

Maximum number of retained WebSocket connections. Default 100.

Link copied to clipboard

Maximum concurrent in-flight requests. Default 16. A request that times out keeps its slot until its handler returns.

Link copied to clipboard

Maximum accepted request body size; larger requests get a 413. Default 1 MB.

Link copied to clipboard

Maximum number of messages and lifecycle events retained per WebSocket connection. Default 1000.

Link copied to clipboard

Bounded request queue capacity. Default 64. A queued request waits at most requestTimeoutMs for a slot, then gets a 503. The server also keeps at most maxConcurrentRequests + requestQueueCapacity + 16 connections open and closes any past that without a response.

Link copied to clipboard

Per-request timeout in milliseconds. Default 30000. A request that runs longer gets a 504 and is cancelled; see DebugRequest.onCancel.

Link copied to clipboard

The TCP port the debug server binds to. Default 8080.

Link copied to clipboard

Total in-memory budget for WebSocket message payloads, in bytes. Default 16 MB.