KtorLocalServerEngine

class KtorLocalServerEngine(sessionAuthority: SessionAuthority = SessionAuthority(), sessionCodeAuthority: SessionCodeAuthority = SessionCodeAuthority(sessionAuthority), metadata: () -> ServerMetadata = { ServerMetadata() }, sdkHealth: () -> SdkHealthSnapshot = { SdkHealthSnapshot() }, networkTransactions: NetworkTransactionStore = InMemoryNetworkTransactionStore(NetworkCursorCodec(ByteArray(16).also(SecureRandom()::nextBytes))), socketStore: SocketStore = InMemorySocketStore(), pushStore: PushStore = InMemoryPushStore(), stateRegistry: StateRegistry = StateRegistry(), featureFlags: SessionFeatureFlags = SessionFeatureFlags(emptyList()), mockEngine: MockEngine = MockEngine(emptyList()), mocksEditable: Boolean = false, captureRules: CaptureRuleEngine = CaptureRuleEngine(), captureRulesEditable: Boolean = false, preferencesInspector: PreferencesInspector? = null, preferencesEditable: Boolean = false, databaseInspector: DatabaseInspector? = null, databaseEditable: Boolean = false, fileInspector: FileInspector? = null, filesEditable: Boolean = false, timeline: Timeline = InMemoryTimeline(emptyList(), CursorCodec(ByteArray(16).also(SecureRandom()::nextBytes))), composerEnabled: Boolean = false, composerAllowedHosts: Set<String> = emptySet(), stateMutationsEnabled: Boolean = false, redactionPolicy: RedactionPolicy = RedactionPolicy.default(), pushSimulator: PushSimulator? = null, commandAuditLog: CommandAuditLog = InMemoryCommandAuditLog(), annotations: TimelineAnnotations = InMemoryTimelineAnnotations(), composerCollections: ComposerCollectionStore = InMemoryComposerCollectionStore(), composerExecutor: ComposerExecutor = ComposerExecutor(UrlConnectionComposerTransport()), evidenceStore: EvidenceStore? = null, currentSessionId: () -> String = { "current" }, sessionSnapshotProvider: suspend () -> StoredSession? = { null }, sessionsProvider: suspend () -> List<StoredSession> = { emptyList() }, screenshotCapture: suspend () -> ScreenshotResult = { ScreenshotResult.DisabledForBuild }, lanInterfaces: () -> List<NetworkInterface> = { Collections.list(NetworkInterface.getNetworkInterfaces()) }) : LocalServerEngine

Reference embedded engine. LAN mode binds to the first eligible non-loopback IPv4 address found on an up, non-virtual, non-point-to-point interface (excludes loopback, VPN/tun, and cellular PPP-style links) -- never 0.0.0.0, so the server is reachable only via that specific address, not from every route the device happens to have. Android's local-network runtime permission (where applicable) is gated upstream, by the caller, before start is ever invoked in LAN mode.

Constructors

Link copied to clipboard
constructor(sessionAuthority: SessionAuthority = SessionAuthority(), sessionCodeAuthority: SessionCodeAuthority = SessionCodeAuthority(sessionAuthority), metadata: () -> ServerMetadata = { ServerMetadata() }, sdkHealth: () -> SdkHealthSnapshot = { SdkHealthSnapshot() }, networkTransactions: NetworkTransactionStore = InMemoryNetworkTransactionStore(NetworkCursorCodec(ByteArray(16).also(SecureRandom()::nextBytes))), socketStore: SocketStore = InMemorySocketStore(), pushStore: PushStore = InMemoryPushStore(), stateRegistry: StateRegistry = StateRegistry(), featureFlags: SessionFeatureFlags = SessionFeatureFlags(emptyList()), mockEngine: MockEngine = MockEngine(emptyList()), mocksEditable: Boolean = false, captureRules: CaptureRuleEngine = CaptureRuleEngine(), captureRulesEditable: Boolean = false, preferencesInspector: PreferencesInspector? = null, preferencesEditable: Boolean = false, databaseInspector: DatabaseInspector? = null, databaseEditable: Boolean = false, fileInspector: FileInspector? = null, filesEditable: Boolean = false, timeline: Timeline = InMemoryTimeline(emptyList(), CursorCodec(ByteArray(16).also(SecureRandom()::nextBytes))), composerEnabled: Boolean = false, composerAllowedHosts: Set<String> = emptySet(), stateMutationsEnabled: Boolean = false, redactionPolicy: RedactionPolicy = RedactionPolicy.default(), pushSimulator: PushSimulator? = null, commandAuditLog: CommandAuditLog = InMemoryCommandAuditLog(), annotations: TimelineAnnotations = InMemoryTimelineAnnotations(), composerCollections: ComposerCollectionStore = InMemoryComposerCollectionStore(), composerExecutor: ComposerExecutor = ComposerExecutor(UrlConnectionComposerTransport()), evidenceStore: EvidenceStore? = null, currentSessionId: () -> String = { "current" }, sessionSnapshotProvider: suspend () -> StoredSession? = { null }, sessionsProvider: suspend () -> List<StoredSession> = { emptyList() }, screenshotCapture: suspend () -> ScreenshotResult = { ScreenshotResult.DisabledForBuild }, lanInterfaces: () -> List<NetworkInterface> = { Collections.list(NetworkInterface.getNetworkInterfaces()) })

Properties

Link copied to clipboard

Public so the host facade can publish captured events into the live dashboard stream.

Functions

Link copied to clipboard
open override fun bindAddressChanged(): Boolean
Link copied to clipboard
fun reconfigure(featureFlags: SessionFeatureFlags, composerEnabled: Boolean, composerAllowedHosts: Set<String>, stateMutationsEnabled: Boolean, redactionPolicy: RedactionPolicy, mocksEditable: Boolean = false, captureRulesEditable: Boolean = false, preferencesEditable: Boolean = false, databaseEditable: Boolean = false, filesEditable: Boolean = false)
Link copied to clipboard
open suspend override fun start(request: StartRequest): ServerStartResult
Link copied to clipboard
open suspend override fun stop()
Link copied to clipboard
fun withAttachmentMetadataReader(reader: suspend (String) -> StoredAttachment?): KtorLocalServerEngine
Link copied to clipboard
Link copied to clipboard
fun withRetainedCaptures(query: RetainedCaptureQuery): KtorLocalServerEngine