Ktor Local Server Engine
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()), featureFlagsEditable: Boolean = false, 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()), featureFlagsEditable: Boolean = false, 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
Functions
Link copied to clipboard
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, featureFlagsEditable: Boolean = false)
Link copied to clipboard
fun withAttachmentMetadataReader(reader: suspend (String) -> StoredAttachment?): KtorLocalServerEngine
Link copied to clipboard
Link copied to clipboard