SpeedifyPacketTunnel
@objc
public class SpeedifyPacketTunnel : NSObject
extension SpeedifyPacketTunnel: MXMetricManagerSubscriber
-
Singleton of the
SpeedifyPacketTunnelDeclaration
Swift
@objc public static var sharedInstance: SpeedifyPacketTunnel -
Declaration
Swift
public var safeBrowsingBlockDelegate: PacketTunnelSafeBrowsingBlockDelegate? -
Declaration
Swift
public var currentState: Int -
runDaemon
Declaration
Swift
@available(*, deprecated, message: "Use runDaemon(in port: Int, provider: NEPacketTunnelProvider, options: [String : NSObject]?, connectWithHandler: Bool, completionHandler: @escaping (Error?﹚-> Void﹚") public func runDaemon(in port: Int, provider: NEPacketTunnelProvider, connectWithHandler: Bool, completionHandler: @escaping (Error?) -> Void)Parameters
portPort used for websocket communication with the SpeedifySDK service
providerThe principal class for a packet tunnel provider app extension. This should always be
selfof the users implementation of the PacketTunnelProviderconnectWithHandlerTells the tunnel to connect right away or wait for Speedify. Default should be false
completionHandlerA block that must be executed when the tunnel is fully established, or when the tunnel cannot be started due to an error. If the tunnel was successfully established, then the error parameter must be set to nil. If an error occurred, the error parameter passed to this block must be set to a non-nil NSError object.
-
runDaemon
Declaration
Swift
@available(*, deprecated, message: "Use runDaemon(in port: Int, provider: NEPacketTunnelProvider, connectWithHandler: Bool, completionHandler: @escaping (Error?﹚-> Void﹚") public func runDaemon(in port: Int, provider: NEPacketTunnelProvider, currentDefaults: UserDefaults, connectWithHandler: Bool, completionHandler: @escaping (Error?) -> Void)Parameters
portPort used for websocket communication with the SpeedifySDK service
providerThe principal class for a packet tunnel provider app extension. This should always be
selfof the users implementation of the PacketTunnelProvidercurrentDefaultsUser preferences that Speedify can read. NOTE: If you would like to connect to a speed server from the settings app on a device you MUST pass in a security group default and the same default must be used in the containing application
connectWithHandlerTells the tunnel to connect right away or wait for Speedify. Default should be false
completionHandlerA block that must be executed when the tunnel is fully established, or when the tunnel cannot be started due to an error. If the tunnel was successfully established, then the error parameter must be set to nil. If an error occurred, the error parameter passed to this block must be set to a non-nil NSError object.
-
runDaemon
Declaration
Swift
public func runDaemon(in port: Int, provider: NEPacketTunnelProvider, options: [String : NSObject]?, connectWithHandler: Bool, completionHandler: @escaping (Error?) -> Void)Parameters
portPort used for websocket communication with the SpeedifySDK service
providerThe principal class for a packet tunnel provider app extension. This should always be
selfof the users implementation of the PacketTunnelProvideroptionsUser options passed in when starting a tunnel. These options should be passed from a users implemenation of PacketTunnelPrivider.swift so the SDK can ingest these options from the container
connectWithHandlerTells the tunnel to connect right away or wait for Speedify. Default should be false
completionHandlerA block that must be executed when the tunnel is fully established, or when the tunnel cannot be started due to an error. If the tunnel was successfully established, then the error parameter must be set to nil. If an error occurred, the error parameter passed to this block must be set to a non-nil NSError object.
-
Add this inside of the
willWake()delegate of the Parent Provider https://developer.apple.com/documentation/networkextension/neprovider/1406543-wakeDeclaration
Swift
public func willWake() -
Add this inside of t.he
sleep(completionHandler: @escaping () -> Void)delegate of the Parent Provider https://developer.apple.com/documentation/networkextension/neprovider/1406731-sleepDeclaration
Swift
public func willSleep() -
tunnelWillStop
Declaration
Swift
public func tunnelWillStop(with reason: NEProviderStopReason, completionHandler: (() -> Void)?)Parameters
completionHandlerAn optional block passed in from PacketTunnel provider that will be called to signal the tunnel has stopped. https://developer.apple.com/documentation/networkextension/nepackettunnelprovider/1406192-stoptunnel
-
handleCallBackResponse
Declaration
Swift
public func handleCallBackResponse(_ message: String) -> DataParameters
messageA string to send to the daemon process.
Return Value
Data returned from the daemon process.
-
Declaration
Swift
public func sendExtMessage(command: String?, returnMessages: Bool) -> Data -
Declaration
Swift
public func setupMetricKit() -
Declaration
Swift
public func didReceive(_ payloads: [MXMetricPayload])