<!--
{
  "availability" : [
    "iOS: 13.0.0 - 18.0.0",
    "iPadOS: 13.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.15.0 - 15.0.0",
    "visionOS: 1.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEAppProxyProvider/handleNewUDPFlow(_:initialRemoteEndpoint:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEAppProxyProvider(im)handleNewUDPFlow:initialRemoteEndpoint:"
  },
  "title" : "handleNewUDPFlow(_:initialRemoteEndpoint:)"
}
-->

# handleNewUDPFlow(_:initialRemoteEndpoint:)

Handle a new UDP flow of network data.

```
func handleNewUDPFlow(_ flow: NEAppProxyUDPFlow, initialRemoteEndpoint remoteEndpoint: NWEndpoint) -> Bool
```

## Parameters

`flow`

The new UDP flow.

`remoteEndpoint`

The initial remote endpoint provided by the proxied app when the flow was opened.

## Discussion

The framework calls this function to deliver a new UDP data flow to the proxy provider implementation. Subclasses can override this method to perform whatever steps are necessary to ready the proxy to receive data from the flow.

If you decide to handle the flow, the subclass implementation of this method should return <doc://com.apple.documentation/documentation/Swift/true>. In this case, your implementation is responsible for retaining the [`NEAppProxyUDPFlow`](/documentation/NetworkExtension/NEAppProxyUDPFlow) object.

Your implementation indicates that it’s ready to handle flow data by calling [`open(withLocalEndpoint:completionHandler:)`](/documentation/NetworkExtension/NEAppProxyFlow/open(withLocalEndpoint:completionHandler:)) on the flow.

If you decide to not handle the flow and instead terminate it, your implementation of this method should return <doc://com.apple.documentation/documentation/Swift/false>. This terminates the flow.

The default implementation of this method calls [`handleNewFlow(_:)`](/documentation/NetworkExtension/NEAppProxyProvider/handleNewFlow(_:)) and returns its result.

---

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)