Instance Method

startProxy(options:completionHandler:)

Start the network proxy.

Declaration

func startProxy(options: [String : Any]? = nil, completionHandler: @escaping (Error?) -> Void)

Parameters

options

A dictionary passed by the app that requested that the proxy be started. If the starting app did not specify a dictionary of options then this parameter will be nil. If the proxy was started via Connect On Demand, then this parameter will be nil.

completionHandler

A block that must be executed when the proxy is fully established, or when the proxy cannot be started due to an error. If the proxy 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.

Discussion

This method is called by the system to start the network proxy.

NEAppProxyProvider subclasses must override this method.

When the App Proxy Provider executes the completionHandler block with a nil error parameter, it signals to the system that it is ready to begin handling network data.

The domain and code of the NSError object passed to the completionHandler block are defined by the App Proxy Provider.

See Also

Managing the App Proxy Life Cycle

func cancelProxyWithError(Error?)

Stop the network proxy from the App Proxy Provider.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software