<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEProvider"
  },
  "title" : "NEProvider"
}
-->

# NEProvider

An abstract base class for all NetworkExtension providers.

```
class NEProvider
```

## Overview

See the documentation for the `NEProvider` subclasses for details about how to create Network Extension Provider extensions.

The `NEProvider` class and its subclasses expose methods and properties that allow Network Extension Provider extensions to participate in and affect the network data path on iOS and macOS. For example, the `handleNewFlow:` method in [`NEFilterDataProvider`](/documentation/NetworkExtension/NEFilterDataProvider) allows Filter Data Provider extensions to make pass/block decisions on TCP connections as the connections are established on the system.

### Subclassing Notes

The `NEProvider` class should not be subclassed directly. Instead, you should create subclasses of `NEProvider` subclasses (and in some cases subsubclasses).

#### Methods to Override

- [`sleep(completionHandler:)`](/documentation/NetworkExtension/NEProvider/sleep(completionHandler:))
- [`wake()`](/documentation/NetworkExtension/NEProvider/wake())

## Topics

### Handling sleep and wake

[`-  sleepWithCompletionHandler:`](/documentation/NetworkExtension/NEProvider/sleep(completionHandler:))

Handle a sleep event.

[`-  wake`](/documentation/NetworkExtension/NEProvider/wake())

Handle a wake event.

### Creating network connections

[`-  createTCPConnectionToEndpoint:enableTLS:TLSParameters:delegate:`](/documentation/NetworkExtension/NEProvider/createTCPConnection(to:enableTLS:tlsParameters:delegate:))

Create a TCP connection.

[`-  createUDPSessionToEndpoint:fromEndpoint:`](/documentation/NetworkExtension/NEProvider/createUDPSession(to:from:))

Creates a UDP session.

### Monitoring the network state

[`defaultPath`](/documentation/NetworkExtension/NEProvider/defaultPath)

The current default network path used for connections created by the provider.

### Supporting system extensions

[`+  startSystemExtensionMode`](/documentation/NetworkExtension/NEProvider/startSystemExtensionMode())

Starts the Network Extension machinery from inside a System Extension.

### Constants

[`NEProviderStopReason`](/documentation/NetworkExtension/NEProviderStopReason)

Reasons why the provider extension was stopped.

### Displaying messages

[`-  displayMessage:completionHandler:`](/documentation/NetworkExtension/NEProvider/displayMessage(_:completionHandler:))

Call this method from your [`NEProvider`](/documentation/NetworkExtension/NEProvider) subclass if you want to display a message to the person using the app.

## Relationships

### Inherited By

[`NETunnelProvider`](/documentation/NetworkExtension/NETunnelProvider)

[`NEDNSProxyProvider`](/documentation/NetworkExtension/NEDNSProxyProvider)

[`NEAppPushProvider`](/documentation/NetworkExtension/NEAppPushProvider)

[`NEFilterProvider`](/documentation/NetworkExtension/NEFilterProvider)

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)