<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork/CFNetworkExecuteProxyAutoConfigurationURL(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "c:@F@CFNetworkExecuteProxyAutoConfigurationURL"
  },
  "title" : "CFNetworkExecuteProxyAutoConfigurationURL(_:_:_:_:)"
}
-->

# CFNetworkExecuteProxyAutoConfigurationURL(_:_:_:_:)

Downloads a proxy autoconfiguration script and executes it.

```
func CFNetworkExecuteProxyAutoConfigurationURL(_ proxyAutoConfigURL: CFURL, _ targetURL: CFURL, _ cb: CFProxyAutoConfigurationResultCallback, _ clientContext: UnsafeMutablePointer<CFStreamClientContext>) -> CFRunLoopSource
```

## Parameters

`proxyAutoConfigURL`

The URL of the autoconfiguration script.

`targetURL`

The URL that your application intends to eventually download using the proxies.

`cb`

A callback to be called when execution of the script is finished.

`clientContext`

A stream context containing a client info object and optionally retain and release callbacks for that object.

## Discussion

This function returns a run loop source that the caller should schedule. Once downloading and execution of the script has completed, the specified callback function is called.

> Note:
> If you want to terminate the request before completion, you should invalidate the run loop source.

---

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)