---
title: "stopProxy(with:completionHandler:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/neappproxyprovider/stopproxy(with:completionhandler:)"
---

# stopProxy(with:completionHandler:)

Stop the network proxy.

## Declaration

```swift
func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping @Sendable () -> Void)
```

```swift
func stopProxy(with reason: NEProviderStopReason) async
```

## Parameters

- `reason`: A NEProviderStopReason code indicating why the proxy is being stopped. For a list of possible codes, see doc://com.apple.networkextension/documentation/NetworkExtension/NEProvider.
- `completionHandler`: A block that must be executed when the proxy is fully stopped.

## Discussion

Discussion This method is called by the system to stop the network proxy. NEAppProxyProvider subclasses must override this method. Do not use this method to stop the proxy from the App Proxy Provider. Use cancelProxyWithError: instead.

## See Also

### Managing the app proxy life cycle

- [startProxy(options:completionHandler:)](networkextension/neappproxyprovider/startproxy(options:completionhandler:).md)
- [cancelProxyWithError(_:)](networkextension/neappproxyprovider/cancelproxywitherror(_:).md)
