Add a relay ping and backend status to the iOS app

The relay now answers a stateless ping with pong. The Relay card auto-checks on appear and address changes, showing latency or the connection error; this verifies the endpoint speaks the share protocol, not just that a TCP port is open.
This commit is contained in:
2026-10-27 21:59:27 +08:00
parent decaaa2de1
commit bf5d19900c
6 changed files with 248 additions and 1 deletions
+10
View File
@@ -66,6 +66,16 @@ struct RoomStatus: Codable {
}
}
/// Result of the relay's stateless ping/pong probe. `ok` is true only when
/// the configured address accepted a connection and answered with pong,
/// not merely when the TCP port was open.
struct RelayCheck: Codable, Equatable {
let ok: Bool
let relay: String
let latencyMs: Int64
let error: String?
}
/// A file that has already been copied into the app's seed directory.
/// Holding the copied URL (rather than the security-scoped picker URL)
/// means the Go engine can keep reading it after the picker goes away.