Add support for starting and stopping the tunnel

This commit introduces the Tunnel view model object which has
support for asking for permission, starting and stopping the
tunnel. It automatically updates its state and publishes
changes as an ObservableObject.
This commit is contained in:
Conrad Kramer 2023-05-08 18:19:13 -04:00
parent eeb0130156
commit b3a540fc48
8 changed files with 277 additions and 28 deletions

View file

@ -1,10 +1,18 @@
import NetworkExtension
import SwiftUI
@main
@MainActor
struct BurrowApp: App {
static let tunnel = Tunnel { manager, proto in
proto.serverAddress = "hackclub.com"
manager.localizedDescription = "Burrow"
}
var body: some Scene {
WindowGroup {
ContentView()
TunnelView(tunnel: Self.tunnel)
}
}
}