---
title: "handleNewFlow(_:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/neappproxyprovider/handlenewflow(_:)"
---

# handleNewFlow(_:)

Handle a new flow of network data.

## Declaration

```swift
func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool
```

## Parameters

- `flow`: The new doc://com.apple.networkextension/documentation/NetworkExtension/NEAppProxyFlow object. If the App Proxy Provider decides to proxy the flow, it should create a reference to the flow in its data structures.

## Mentioned in

Handling Flow Copying

## Return Value

Return Value Return true to indicate that the App Proxy Provider will handle the flow. Return false to indicate that the flow should be closed.

## Discussion

Discussion This method is called by the system whenever an app which matches the current App Proxy configuration’s app rules opens a new network connection. NEAppProxyProvider subclasses must override this method. New flows are initially in an unopened state. The App Proxy Provider should take whatever steps are necessary to ready itself to handle the flow data and then open the flow.

## See Also

### Handling proxied flows

- [handleNewUDPFlow(_:initialRemoteEndpoint:)](networkextension/neappproxyprovider/handlenewudpflow(_:initialremoteendpoint:).md)
