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

# NEAppProxyFlow

An abstract base class shared by NEAppProxyTCPFlow and NEAppProxyUDPFlow.

```
class NEAppProxyFlow
```

## Overview

App Proxy Providers receive network connections to be proxied in the form of `NEAppProxyFlow` objects,
which are passed to the App Proxy Provider via the [`handleNewFlow(_:)`](/documentation/NetworkExtension/NEAppProxyProvider/handleNewFlow(_:)) method.

`NEAppProxyFlow` objects are initially in an unopened state.
Before they can be used to transmit network data,
they must be opened using the [`open(withLocalEndpoint:completionHandler:)`](/documentation/NetworkExtension/NEAppProxyFlow/open(withLocalEndpoint:completionHandler:)) method.
When you are finished with a flow, you should call
[`closeReadWithError(_:)`](/documentation/NetworkExtension/NEAppProxyFlow/closeReadWithError(_:)) and [`closeWriteWithError(_:)`](/documentation/NetworkExtension/NEAppProxyFlow/closeWriteWithError(_:)),
and then release the `NEAppProxyFlow` object.

## Topics

### Managing the flow life cycle

[`-  openWithLocalEndpoint:completionHandler:`](/documentation/NetworkExtension/NEAppProxyFlow/open(withLocalEndpoint:completionHandler:))

Opens the flow, indicating to the system that the caller is ready to start receiving and sending data.

[`-  closeReadWithError:`](/documentation/NetworkExtension/NEAppProxyFlow/closeReadWithError(_:))

Close the flow for further read operations.

[`-  closeWriteWithError:`](/documentation/NetworkExtension/NEAppProxyFlow/closeWriteWithError(_:))

Close the flow for further write operations.

### Accessing flow information

[`metaData`](/documentation/NetworkExtension/NEAppProxyFlow/metaData)

A metadata object containing information about the source app of the flow.

[`-  setMetadata:`](/documentation/NetworkExtension/NEAppProxyFlow/setMetadata(_:))

Sets the flow’s metadata for use by proxy providers.

  <doc://com.apple.documentation/documentation/Network/nw_parameters_t>

[`isBound`](/documentation/NetworkExtension/NEAppProxyFlow/isBound)

A Boolean value that indicates whether the flow has a binding to a specific interface.

[`networkInterface`](/documentation/NetworkExtension/NEAppProxyFlow/networkInterface)

The network interface, if any, used by this flow.

  <doc://com.apple.documentation/documentation/Network/nw_interface_type_t>

[`remoteHostname`](/documentation/NetworkExtension/NEAppProxyFlow/remoteHostname)

The remote host name for flows created from a hostname.

### Errors

[`NEAppProxyFlowError`](/documentation/NetworkExtension/NEAppProxyFlowError-swift.struct)

An error that the app proxy flow encounters.

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

The domain used for app proxy errors.

[`Code`](/documentation/NetworkExtension/NEAppProxyFlowError-swift.struct/Code)

Error codes that the app proxy flow API declares.

[`NEAppProxyFlowError`](/documentation/NetworkExtension/NEAppProxyFlowError-swift.struct)

An error that the app proxy flow encounters.

## Relationships

### Conforms To

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

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

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

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

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

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

### Inherited By

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

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

### 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)