SpeedifyPacketTunnel

@objc
public class SpeedifyPacketTunnel : NSObject
extension SpeedifyPacketTunnel: MXMetricManagerSubscriber
  • Singleton of the SpeedifyPacketTunnel

    Declaration

    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

    port

    Port used for websocket communication with the SpeedifySDK service

    provider

    The principal class for a packet tunnel provider app extension. This should always be self of the users implementation of the PacketTunnelProvider

    connectWithHandler

    Tells the tunnel to connect right away or wait for Speedify. Default should be false

    completionHandler

    A 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

    port

    Port used for websocket communication with the SpeedifySDK service

    provider

    The principal class for a packet tunnel provider app extension. This should always be self of the users implementation of the PacketTunnelProvider

    currentDefaults

    User 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

    connectWithHandler

    Tells the tunnel to connect right away or wait for Speedify. Default should be false

    completionHandler

    A 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

    port

    Port used for websocket communication with the SpeedifySDK service

    provider

    The principal class for a packet tunnel provider app extension. This should always be self of the users implementation of the PacketTunnelProvider

    options

    User 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

    connectWithHandler

    Tells the tunnel to connect right away or wait for Speedify. Default should be false

    completionHandler

    A 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-wake

    Declaration

    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-sleep

    Declaration

    Swift

    public func willSleep()
  • Declaration

    Swift

    public func reportSafeBrowsingHomeNetwork()
  • tunnelWillStop

    Declaration

    Swift

    public func tunnelWillStop(with reason: NEProviderStopReason, completionHandler: (() -> Void)?)

    Parameters

    completionHandler

    An 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) -> Data

    Parameters

    message

    A 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 didReceive(_ payloads: [MXMetricPayload])