- Adaptive iPhone/iPad layout with NavigationSplitView sidebar - Auto-detect SSL-pinned domains, fall back to passthrough - Certificate install via local HTTP server (Safari profile flow) - App Group-backed CA, per-domain leaf cert LRU cache - DB-backed config repository, Darwin notification throttling - Rules engine, breakpoint rules, pinned domain tracking - os.Logger instrumentation across tunnel/proxy/mitm/capture/cert/rules/db/ipc/ui - Fix dyld framework embed, race conditions, thread safety
62 lines
2.0 KiB
Swift
62 lines
2.0 KiB
Swift
import Foundation
|
|
import GRDB
|
|
|
|
public enum ProxyRuntimeState: String, Codable, Sendable {
|
|
case stopped
|
|
case starting
|
|
case running
|
|
case failed
|
|
}
|
|
|
|
public struct ProxyRuntimeStatus: Codable, FetchableRecord, MutablePersistableRecord, Sendable {
|
|
public static let databaseTableName = "proxy_runtime_status"
|
|
|
|
public var id: Int64
|
|
public var tunnelState: String
|
|
public var proxyHost: String?
|
|
public var proxyPort: Int?
|
|
public var caFingerprint: String?
|
|
public var lastProxyError: String?
|
|
public var lastMITMError: String?
|
|
public var lastConnectError: String?
|
|
public var lastSuccessfulMITMDomain: String?
|
|
public var lastSuccessfulMITMAt: Double?
|
|
public var lastExtensionStartAt: Double?
|
|
public var lastExtensionStopAt: Double?
|
|
public var updatedAt: Double
|
|
|
|
public init(
|
|
id: Int64 = 1,
|
|
tunnelState: ProxyRuntimeState = .stopped,
|
|
proxyHost: String? = nil,
|
|
proxyPort: Int? = nil,
|
|
caFingerprint: String? = nil,
|
|
lastProxyError: String? = nil,
|
|
lastMITMError: String? = nil,
|
|
lastConnectError: String? = nil,
|
|
lastSuccessfulMITMDomain: String? = nil,
|
|
lastSuccessfulMITMAt: Double? = nil,
|
|
lastExtensionStartAt: Double? = nil,
|
|
lastExtensionStopAt: Double? = nil,
|
|
updatedAt: Double = Date().timeIntervalSince1970
|
|
) {
|
|
self.id = id
|
|
self.tunnelState = tunnelState.rawValue
|
|
self.proxyHost = proxyHost
|
|
self.proxyPort = proxyPort
|
|
self.caFingerprint = caFingerprint
|
|
self.lastProxyError = lastProxyError
|
|
self.lastMITMError = lastMITMError
|
|
self.lastConnectError = lastConnectError
|
|
self.lastSuccessfulMITMDomain = lastSuccessfulMITMDomain
|
|
self.lastSuccessfulMITMAt = lastSuccessfulMITMAt
|
|
self.lastExtensionStartAt = lastExtensionStartAt
|
|
self.lastExtensionStopAt = lastExtensionStopAt
|
|
self.updatedAt = updatedAt
|
|
}
|
|
|
|
public var state: ProxyRuntimeState {
|
|
ProxyRuntimeState(rawValue: tunnelState) ?? .stopped
|
|
}
|
|
}
|