<!--
{
  "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/NEAppProxyProvider/stopProxy(with:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEAppProxyProvider(im)stopProxyWithReason:completionHandler:"
  },
  "title" : "stopProxy(with:completionHandler:)"
}
-->

# stopProxy(with:completionHandler:)

Stop the network proxy.

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

## Parameters

`reason`

A `NEProviderStopReason` code indicating why the proxy is being stopped. For a list of possible codes, see [`NEProvider`](/documentation/NetworkExtension/NEProvider).

`completionHandler`

A block that must be executed when the proxy is fully stopped.

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

---

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)