<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEDNSProxyProvider/startProxy(options:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEDNSProxyProvider(im)startProxyWithOptions:completionHandler:"
  },
  "title" : "startProxy(options:completionHandler:)"
}
-->

# startProxy(options:completionHandler:)

Starts the DNS proxy.

```
func startProxy(options: [String : Any]? = nil, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`options`

A dictionary that you define as part of a device configuration profile. You can also modify the contents of this dictionary from your app using the shared instance of [`NEDNSProxyManager`](/documentation/NetworkExtension/NEDNSProxyManager). The dictionary appears as the [`providerConfiguration`](/documentation/NetworkExtension/NEDNSProxyProviderProtocol/providerConfiguration) component of the manager’s [`providerProtocol`](/documentation/NetworkExtension/NEDNSProxyManager/providerProtocol) property.

`completionHandler`

A block that you must execute when the proxy is fully established, or when the proxy cannot be started due to an error. If the proxy is successfully established, the error parameter should be set to `nil`. Otherwise, the error parameter passed to this block indicates the reason for failure.

## Discussion

Subclasses of [`NEDNSProxyProvider`](/documentation/NetworkExtension/NEDNSProxyProvider) must override this method to perform any necessary steps to ready the proxy for handling flows of network data.

The framework calls this method when a new proxy instance is created. You indicate that setup is complete by calling the completion handler with a `nil` error parameter, or that setup failed by calling the completion handler with an error instance. You define the error domain and code.

---

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)