The principal class for an app proxy provider app extension.


class NEAppProxyProvider : NETunnelProvider


The NEAppProxyProvider class provides access to flows of network data in the form of NEAppProxyFlow objects. Each NEAppProxyFlow object corresponds to a socket opened by an app that matches the app rules specified in the current App Proxy configuration. Your App Proxy Provider acts as a transparent network proxy for the flows of network data that it receives.

DNS Handling

In addition to flows of raw network data from applications, the App Proxy Provider also receives flows of DNS queries in the form of NEAppProxyUDPFlow objects. DNS query flows are received only for applications that use low-level DNS resolution APIs such as DNSServiceGetAddrInfo(_:_:_:_:_:_:_:)(). The App Proxy Provider can specify the DNS resolver configuration that will be used by these applications using the setTunnelNetworkSettings(_:completionHandler:) method.

Applications that use higher-level networking APIs such as URLSession and NSURLConnection do not generate DNS queries. Instead the destination hostname for the connection is included in the endpoint information of the NEAppProxyFlow object.

Creating an App Proxy Provider Extension

App Proxy Providers run as App Extensions for the extension point.

To create a App Proxy Provider extension, first create a new App Extension target in your project.

For an example of an Xcode build target for this app extension, see the SimpleTunnel: Customized Networking Using the NetworkExtension Framework sample code project.

Once you have a App Proxy Provider extension target, create a sub-class of NEAppProxyProvider. Then, set the NSExtensionPrincipalClass key in the the extension’s Info.plist to the name of your sub-class.

If it is not already done, set the NSExtensionPointIdentifier key in the extension’s Info.plist to

Here is an example of the NSExtension dictionary in a App Proxy Provider extension’s Info.plist:


Finally, add your App Proxy Provider extension target to your app’s Embed App Extensions build phase.

Subclassing Notes

In order to create a App Proxy Provider extension, you must create a subclass of NEAppProxyProvider and override the methods listed below.

Methods to Override


Managing the App Proxy Life Cycle

Handling Proxied Flows


Inherits From

Conforms To

See Also

App Proxy Provider

class NEProvider

An abstract base class for all NetworkExtension providers.

class NETunnelNetworkSettings

The configuration for a tunnel provider’s virtual interface.