mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-11 15:53:30 +01:00
WireGuard extension
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
This commit is contained in:
42
WireguardNetworkExtension/AppProxyProvider.swift
Normal file
42
WireguardNetworkExtension/AppProxyProvider.swift
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// AppProxyProvider.swift
|
||||
// WireguardNetworkExtension
|
||||
//
|
||||
// Created by Joseph Mattiello on 11/12/22.
|
||||
// Copyright © 2022 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import NetworkExtension
|
||||
|
||||
class AppProxyProvider: NEAppProxyProvider {
|
||||
|
||||
override func startProxy(options: [String : Any]? = nil, completionHandler: @escaping (Error?) -> Void) {
|
||||
// Add code here to start the process of connecting the tunnel.
|
||||
}
|
||||
|
||||
override func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) {
|
||||
// Add code here to start the process of stopping the tunnel.
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
override func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)?) {
|
||||
// Add code here to handle the message.
|
||||
if let handler = completionHandler {
|
||||
handler(messageData)
|
||||
}
|
||||
}
|
||||
|
||||
override func sleep(completionHandler: @escaping() -> Void) {
|
||||
// Add code here to get ready to sleep.
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
override func wake() {
|
||||
// Add code here to wake up.
|
||||
}
|
||||
|
||||
override func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool {
|
||||
// Add code here to handle the incoming flow.
|
||||
return false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user