---
title: "CFNetworkExecuteProxyAutoConfigurationScript(_:_:_:_:)"
framework: cfnetwork
role: symbol
role_heading: Function
path: "cfnetwork/cfnetworkexecuteproxyautoconfigurationscript(_:_:_:_:)"
---

# CFNetworkExecuteProxyAutoConfigurationScript(_:_:_:_:)

Downloads a proxy autoconfiguration script and executes it.

## Declaration

```swift
func CFNetworkExecuteProxyAutoConfigurationScript(_ proxyAutoConfigurationScript: CFString, _ targetURL: CFURL, _ cb: CFProxyAutoConfigurationResultCallback, _ clientContext: UnsafeMutablePointer<CFStreamClientContext>) -> CFRunLoopSource
```

## Parameters

- `proxyAutoConfigurationScript`: A CFString containing the code of the autoconfiguration script to be executed.
- `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

Discussion This function returns a run loop source that the caller should schedule. Once 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.

## See Also

### Global Proxy Configuration

- [CFNetworkCopyProxiesForURL(_:_:)](cfnetwork/cfnetworkcopyproxiesforurl(_:_:).md)
- [CFNetworkCopyProxiesForAutoConfigurationScript(_:_:_:)](cfnetwork/cfnetworkcopyproxiesforautoconfigurationscript(_:_:_:).md)
- [CFNetworkExecuteProxyAutoConfigurationURL(_:_:_:_:)](cfnetwork/cfnetworkexecuteproxyautoconfigurationurl(_:_:_:_:).md)
- [CFNetworkCopySystemProxySettings()](cfnetwork/cfnetworkcopysystemproxysettings().md)
- [CFProxyAutoConfigurationResultCallback](cfnetwork/cfproxyautoconfigurationresultcallback.md)
- [Property Keys](cfnetwork/property-keys.md)
- [Proxy Types](cfnetwork/proxy-types.md)
- [Global Proxy Settings Constants](cfnetwork/global-proxy-settings-constants.md)
