<!--
{
  "availability" : [
    "iOS: 2.0 -",
    "iPadOS: 2.0 -",
    "macCatalyst: 13.0 -",
    "macOS: 10.8 -",
    "tvOS: 9.0 -",
    "visionOS: 1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "CFNetwork"
  },
  "title" : "CFNetwork"
}
-->

# CFNetwork

Access network services and handle changes in network configurations. Build on abstractions of network protocols to simplify tasks such as working with BSD sockets, administering HTTP and FTP servers, and managing Bonjour services.

## Topics

### Errors

[`CFNetworkErrors`](/documentation/CFNetwork/CFNetworkErrors)

This enumeration contains error codes returned under the error domain [`kCFErrorDomainCFNetwork`](/documentation/CFNetwork/kCFErrorDomainCFNetwork).

[Error Dictionary Keys](/documentation/CFNetwork/error-dictionary-keys)

Networking-related keys that may be available in a `CFErrorRef` object’s `userInfo` dictionary.

[Error Domains](/documentation/CFNetwork/error-domains)

High-level error domains.

### Hosts

[`CFHost`](/documentation/CFNetwork/CFHost)

An opaque reference representing an CFHost object.

[`CFHostInfoType`](/documentation/CFNetwork/CFHostInfoType)

Values indicating the type of data that is to be resolved or the type of data that was resolved.

[`CFHostClientContext`](/documentation/CFNetwork/CFHostClientContext)

A structure containing user-defined data and callbacks for CFHost objects.

[`CFHostCancelInfoResolution(_:_:)`](/documentation/CFNetwork/CFHostCancelInfoResolution(_:_:))

Cancels the resolution of a host.

[`CFHostCreateCopy(_:_:)`](/documentation/CFNetwork/CFHostCreateCopy(_:_:))

Creates a new host object by copying.

[`CFHostCreateWithAddress(_:_:)`](/documentation/CFNetwork/CFHostCreateWithAddress(_:_:))

Uses an address to create an instance of a host object.

[`CFHostCreateWithName(_:_:)`](/documentation/CFNetwork/CFHostCreateWithName(_:_:))

Uses a name to create an instance of a host object.

[`CFHostGetAddressing(_:_:)`](/documentation/CFNetwork/CFHostGetAddressing(_:_:))

Gets the addresses from a host.

[`CFHostGetNames(_:_:)`](/documentation/CFNetwork/CFHostGetNames(_:_:))

Gets the names from a CFHost.

[`CFHostGetReachability(_:_:)`](/documentation/CFNetwork/CFHostGetReachability(_:_:))

Gets reachability information from a host.

[`CFHostGetTypeID()`](/documentation/CFNetwork/CFHostGetTypeID())

Gets the Core Foundation type identifier for the CFHost opaque type.

[`CFHostScheduleWithRunLoop(_:_:_:)`](/documentation/CFNetwork/CFHostScheduleWithRunLoop(_:_:_:))

Schedules a CFHost on a run loop.

[`CFHostSetClient(_:_:_:)`](/documentation/CFNetwork/CFHostSetClient(_:_:_:))

Associates a client context and a callback function with a CFHost object or disassociates a client context and callback function that were previously set.

[`CFHostStartInfoResolution(_:_:_:)`](/documentation/CFNetwork/CFHostStartInfoResolution(_:_:_:))

Starts resolution for a host object.

[`CFHostUnscheduleFromRunLoop(_:_:_:)`](/documentation/CFNetwork/CFHostUnscheduleFromRunLoop(_:_:_:))

Unschedules a CFHost from a run loop.

### Global Proxy Configuration

[`CFNetworkCopyProxiesForURL(_:_:)`](/documentation/CFNetwork/CFNetworkCopyProxiesForURL(_:_:))

Returns the list of proxies that should be used to download a given URL.

[`CFNetworkCopyProxiesForAutoConfigurationScript(_:_:_:)`](/documentation/CFNetwork/CFNetworkCopyProxiesForAutoConfigurationScript(_:_:_:))

Executes a proxy autoconfiguration script to determine the best proxy to use to retrieve a specified URL.

[`CFNetworkExecuteProxyAutoConfigurationScript(_:_:_:_:)`](/documentation/CFNetwork/CFNetworkExecuteProxyAutoConfigurationScript(_:_:_:_:))

Downloads a proxy autoconfiguration script and executes it.

[`CFNetworkExecuteProxyAutoConfigurationURL(_:_:_:_:)`](/documentation/CFNetwork/CFNetworkExecuteProxyAutoConfigurationURL(_:_:_:_:))

Downloads a proxy autoconfiguration script and executes it.

[`CFNetworkCopySystemProxySettings()`](/documentation/CFNetwork/CFNetworkCopySystemProxySettings())

Returns a CFDictionary containing the current systemwide internet proxy settings.

[`CFProxyAutoConfigurationResultCallback`](/documentation/CFNetwork/CFProxyAutoConfigurationResultCallback)

Callback function called when a proxy autoconfiguration computation has completed.

[Property Keys](/documentation/CFNetwork/property-keys)

Keys for calls to property get/set functions such as <doc://com.apple.documentation/documentation/CoreFoundation/CFReadStreamSetProperty(_:_:_:)> and <doc://com.apple.documentation/documentation/CoreFoundation/CFReadStreamCopyProperty(_:_:)>.

[Proxy Types](/documentation/CFNetwork/proxy-types)

Constants that specify the type of proxy.

[Global Proxy Settings Constants](/documentation/CFNetwork/global-proxy-settings-constants)

Constants for keys in the global proxy settings dictionary returned by [`CFNetworkCopySystemProxySettings()`](/documentation/CFNetwork/CFNetworkCopySystemProxySettings()).

### HTTP Authentication

[`CFHTTPAuthentication`](/documentation/CFNetwork/CFHTTPAuthentication)

An opaque reference representing HTTP authentication information.

[`CFHTTPAuthenticationAppliesToRequest(_:_:)`](/documentation/CFNetwork/CFHTTPAuthenticationAppliesToRequest(_:_:))

Returns a Boolean value that indicates whether a CFHTTPAuthentication object is associated with a CFHTTPMessage object.

[`CFHTTPAuthenticationCopyDomains(_:)`](/documentation/CFNetwork/CFHTTPAuthenticationCopyDomains(_:))

Returns an array of domain URLs to which a given CFHTTPAuthentication object can be applied.

[`CFHTTPAuthenticationCopyMethod(_:)`](/documentation/CFNetwork/CFHTTPAuthenticationCopyMethod(_:))

Gets the strongest authentication method that will be used when a CFHTTPAuthentication object is applied to a request.

[`CFHTTPAuthenticationCopyRealm(_:)`](/documentation/CFNetwork/CFHTTPAuthenticationCopyRealm(_:))

Gets an authentication information’s namespace.

[`CFHTTPAuthenticationCreateFromResponse(_:_:)`](/documentation/CFNetwork/CFHTTPAuthenticationCreateFromResponse(_:_:))

Uses an authentication failure response to create a CFHTTPAuthentication object.

[`CFHTTPAuthenticationGetTypeID()`](/documentation/CFNetwork/CFHTTPAuthenticationGetTypeID())

Gets the Core Foundation type identifier for the CFHTTPAuthentication opaque type.

[`CFHTTPAuthenticationIsValid(_:_:)`](/documentation/CFNetwork/CFHTTPAuthenticationIsValid(_:_:))

Returns a Boolean value that indicates whether a CFHTTPAuthentication object is valid.

[`CFHTTPAuthenticationRequiresAccountDomain(_:)`](/documentation/CFNetwork/CFHTTPAuthenticationRequiresAccountDomain(_:))

Returns a Boolean value that indicates whether a CFHTTPAuthentication object uses an authentication method that requires an account domain.

[`CFHTTPAuthenticationRequiresOrderedRequests(_:)`](/documentation/CFNetwork/CFHTTPAuthenticationRequiresOrderedRequests(_:))

Returns a Boolean value that indicates whether authentication requests should be made one at a time.

[`CFHTTPAuthenticationRequiresUserNameAndPassword(_:)`](/documentation/CFNetwork/CFHTTPAuthenticationRequiresUserNameAndPassword(_:))

Returns a Boolean value that indicates whether a CFHTTPAuthentication object uses an authentication method that requires a username and a password.

[`kCFHTTPAuthenticationAccountDomain`](/documentation/CFNetwork/kCFHTTPAuthenticationAccountDomain)

Account domain to use for authentication.

[`kCFHTTPAuthenticationPassword`](/documentation/CFNetwork/kCFHTTPAuthenticationPassword)

Password to use for authentication.

[`kCFHTTPAuthenticationSchemeBasic`](/documentation/CFNetwork/kCFHTTPAuthenticationSchemeBasic)

Request the HTTP basic authentication scheme.

[`kCFHTTPAuthenticationSchemeDigest`](/documentation/CFNetwork/kCFHTTPAuthenticationSchemeDigest)

Request the HTTP digest authentication scheme.

[`kCFHTTPAuthenticationSchemeKerberos`](/documentation/CFNetwork/kCFHTTPAuthenticationSchemeKerberos)

Request the HTTP Kerberos authentication scheme.

[`kCFHTTPAuthenticationSchemeNTLM`](/documentation/CFNetwork/kCFHTTPAuthenticationSchemeNTLM)

Request the HTTP NTLM authentication scheme.

[`kCFHTTPAuthenticationSchemeNegotiate`](/documentation/CFNetwork/kCFHTTPAuthenticationSchemeNegotiate)

Request the HTTP Negotiate authentication scheme.

[`kCFHTTPAuthenticationSchemeNegotiate2`](/documentation/CFNetwork/kCFHTTPAuthenticationSchemeNegotiate2)

Request the HTTP Negotiate v2 authentication scheme.

[`kCFHTTPAuthenticationSchemeXMobileMeAuthToken`](/documentation/CFNetwork/kCFHTTPAuthenticationSchemeXMobileMeAuthToken)

Request the HTTP XMobileMeAuthToken authentication scheme.

[`kCFHTTPAuthenticationUsername`](/documentation/CFNetwork/kCFHTTPAuthenticationUsername)

Username to use for authentication.

### HTTP Messages

[`CFHTTPMessage`](/documentation/CFNetwork/CFHTTPMessage)

An opaque reference representing an HTTP message.

[`CFHTTPMessageAddAuthentication(_:_:_:_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageAddAuthentication(_:_:_:_:_:_:))

Adds authentication information to a request.

[`CFHTTPMessageAppendBytes(_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageAppendBytes(_:_:_:))

Appends data to a `CFHTTPMessage` object.

[`CFHTTPMessageApplyCredentialDictionary(_:_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageApplyCredentialDictionary(_:_:_:_:))

Use a dictionary containing authentication credentials to perform the authentication method specified by a `CFHTTPAuthentication` object.

[`CFHTTPMessageApplyCredentials(_:_:_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageApplyCredentials(_:_:_:_:_:))

Performs the authentication method specified by a `CFHTTPAuthentication` object.

[`CFHTTPMessageCopyAllHeaderFields(_:)`](/documentation/CFNetwork/CFHTTPMessageCopyAllHeaderFields(_:))

Gets all header fields from a `CFHTTPMessage` object.

[`CFHTTPMessageCopyBody(_:)`](/documentation/CFNetwork/CFHTTPMessageCopyBody(_:))

Gets the body from a `CFHTTPMessage` object.

[`CFHTTPMessageCopyHeaderFieldValue(_:_:)`](/documentation/CFNetwork/CFHTTPMessageCopyHeaderFieldValue(_:_:))

Gets the value of a header field from a `CFHTTPMessage` object.

[`CFHTTPMessageCopyRequestMethod(_:)`](/documentation/CFNetwork/CFHTTPMessageCopyRequestMethod(_:))

Gets the request method from a `CFHTTPMessage` object.

[`CFHTTPMessageCopyRequestURL(_:)`](/documentation/CFNetwork/CFHTTPMessageCopyRequestURL(_:))

Gets the URL from a `CFHTTPMessage` object.

[`CFHTTPMessageCopyResponseStatusLine(_:)`](/documentation/CFNetwork/CFHTTPMessageCopyResponseStatusLine(_:))

Gets the status line from a `CFHTTPMessage` object.

[`CFHTTPMessageCopySerializedMessage(_:)`](/documentation/CFNetwork/CFHTTPMessageCopySerializedMessage(_:))

Serializes a CFHTTPMessage object.

[`CFHTTPMessageCopyVersion(_:)`](/documentation/CFNetwork/CFHTTPMessageCopyVersion(_:))

Gets the HTTP version from a `CFHTTPMessage` object.

[`CFHTTPMessageCreateCopy(_:_:)`](/documentation/CFNetwork/CFHTTPMessageCreateCopy(_:_:))

Gets a copy of a CFHTTPMessage object.

[`CFHTTPMessageCreateEmpty(_:_:)`](/documentation/CFNetwork/CFHTTPMessageCreateEmpty(_:_:))

Creates and returns a new, empty `CFHTTPMessage` object.

[`CFHTTPMessageCreateRequest(_:_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageCreateRequest(_:_:_:_:))

Creates and returns a `CFHTTPMessage` object for an HTTP request.

[`CFHTTPMessageCreateResponse(_:_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageCreateResponse(_:_:_:_:))

Creates and returns a `CFHTTPMessage` object for an HTTP response.

[`CFHTTPMessageGetResponseStatusCode(_:)`](/documentation/CFNetwork/CFHTTPMessageGetResponseStatusCode(_:))

Gets the status code from a `CFHTTPMessage` object representing an HTTP response.

[`CFHTTPMessageGetTypeID()`](/documentation/CFNetwork/CFHTTPMessageGetTypeID())

Returns the Core Foundation type identifier for the `CFHTTPMessage` opaque type.

[`CFHTTPMessageIsHeaderComplete(_:)`](/documentation/CFNetwork/CFHTTPMessageIsHeaderComplete(_:))

Determines whether a message header is complete.

[`CFHTTPMessageIsRequest(_:)`](/documentation/CFNetwork/CFHTTPMessageIsRequest(_:))

Returns a Boolean indicating whether the HTTP message is a request or a response.

[`CFHTTPMessageSetBody(_:_:)`](/documentation/CFNetwork/CFHTTPMessageSetBody(_:_:))

Sets the body of a `CFHTTPMessage` object.

[`CFHTTPMessageSetHeaderFieldValue(_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageSetHeaderFieldValue(_:_:_:))

Sets the value of a header field in an HTTP message.

[`kCFHTTPVersion1_0`](/documentation/CFNetwork/kCFHTTPVersion1_0)

Specifies HTTP version 1.0.

[`kCFHTTPVersion1_1`](/documentation/CFNetwork/kCFHTTPVersion1_1)

Specifies HTTP version 1.1.

[`kCFHTTPVersion2_0`](/documentation/CFNetwork/kCFHTTPVersion2_0)

HTTP version 2.0.

### FTP

[`CFFTPCreateParsedResourceListing(_:_:_:_:)`](/documentation/CFNetwork/CFFTPCreateParsedResourceListing(_:_:_:_:))

Parses an FTP listing to a dictionary.

[`kCFFTPResourceGroup`](/documentation/CFNetwork/kCFFTPResourceGroup)

CFDictionary key for getting the CFString containing the name of a group that shares the FTP resource.

[`kCFFTPResourceLink`](/documentation/CFNetwork/kCFFTPResourceLink)

CFDictionary key for getting the CFString containing the symbolic link information. If the item is a symbolic link, the CFString contains the path to the item that the link references.

[`kCFFTPResourceModDate`](/documentation/CFNetwork/kCFFTPResourceModDate)

CFDictionary key for getting the CFDate containing the last date and time the FTP resource was modified.

[`kCFFTPResourceMode`](/documentation/CFNetwork/kCFFTPResourceMode)

CFDictionary key for getting the CFNumber containing the access permissions, defined in `sys/types.h`, of the FTP resource.

[`kCFFTPResourceName`](/documentation/CFNetwork/kCFFTPResourceName)

CFDictionary key for getting the CFString containing the name of the FTP resource.

[`kCFFTPResourceOwner`](/documentation/CFNetwork/kCFFTPResourceOwner)

CFDictionary key for getting the CFString containing the name of the owner of the FTP resource.

[`kCFFTPResourceSize`](/documentation/CFNetwork/kCFFTPResourceSize)

CFDictionary key for getting the CFNumber containing the size in bytes of the FTP resource.

[`kCFFTPResourceType`](/documentation/CFNetwork/kCFFTPResourceType)

CFDictionary key for getting the CFNumber containing the type of the FTP resource as defined in `sys/dirent.h`.

### Network Diagnostics

[`CFNetDiagnostic`](/documentation/CFNetwork/CFNetDiagnostic)

An opaque reference representing a CFNetDiagnostic.

[`CFNetDiagnosticStatusValues`](/documentation/CFNetwork/CFNetDiagnosticStatusValues)

Constants for diagnostic status values.

[`CFNetDiagnosticCopyNetworkStatusPassively(_:_:)`](/documentation/CFNetwork/CFNetDiagnosticCopyNetworkStatusPassively(_:_:))

Gets a network status value.

[`CFNetDiagnosticCreateWithStreams(_:_:_:)`](/documentation/CFNetwork/CFNetDiagnosticCreateWithStreams(_:_:_:))

Creates a network diagnostic object from a pair of CFStreams.

[`CFNetDiagnosticCreateWithURL(_:_:)`](/documentation/CFNetwork/CFNetDiagnosticCreateWithURL(_:_:))

Creates a CFNetDiagnosticRef from a CFURLRef.

[`CFNetDiagnosticDiagnoseProblemInteractively(_:)`](/documentation/CFNetwork/CFNetDiagnosticDiagnoseProblemInteractively(_:))

Opens a Network Diagnostics window.

[`CFNetDiagnosticSetName(_:_:)`](/documentation/CFNetwork/CFNetDiagnosticSetName(_:_:))

Overrides the displayed application name.

### Network Services

[`CFNetService`](/documentation/CFNetwork/CFNetService)

An opaque reference representing a CFNetService.

[`CFNetServiceBrowser`](/documentation/CFNetwork/CFNetServiceBrowser)

An opaque reference representing a CFNetServiceBrowser.

[`CFNetServiceBrowserFlags`](/documentation/CFNetwork/CFNetServiceBrowserFlags)

Flags that the system passes to net service browser callbacks.

[`CFNetServiceMonitor`](/documentation/CFNetwork/CFNetServiceMonitor)

An opaque reference for a service monitor.

[`CFNetServiceMonitorType`](/documentation/CFNetwork/CFNetServiceMonitorType)

Record type specifier used to tell a service monitor the type of record changes to watch for.

[`CFNetServiceClientContext`](/documentation/CFNetwork/CFNetServiceClientContext)

A structure provided when a CFNetService is associated with a callback function or when a CFNetServiceBrowser is created.

[`CFNetServiceRegisterFlags`](/documentation/CFNetwork/CFNetServiceRegisterFlags)

Options to use when registering a service on the network.

[`CFNetServicesError`](/documentation/CFNetwork/CFNetServicesError)

Error codes that may be returned by CFNetServices functions or passed to CFNetServices callback functions.

[`CFNetServiceBrowserInvalidate(_:)`](/documentation/CFNetwork/CFNetServiceBrowserInvalidate(_:))

Invalidates an instance of a Network Service browser object.

[`CFNetServiceBrowserScheduleWithRunLoop(_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserScheduleWithRunLoop(_:_:_:))

Schedules a CFNetServiceBrowser on a run loop.

[`CFNetServiceBrowserCreate(_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserCreate(_:_:_:))

Creates an instance of a Network Service browser object.

[`CFNetServiceBrowserGetTypeID()`](/documentation/CFNetwork/CFNetServiceBrowserGetTypeID())

Gets the Core Foundation type identifier for the Network Service browser object.

[`CFNetServiceBrowserSearchForDomains(_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserSearchForDomains(_:_:_:))

Searches for domains.

[`CFNetServiceBrowserSearchForServices(_:_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserSearchForServices(_:_:_:_:))

Searches a domain for services of a specified type.

[`CFNetServiceBrowserStopSearch(_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserStopSearch(_:_:))

Stops a search for domains or services.

[`CFNetServiceBrowserUnscheduleFromRunLoop(_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserUnscheduleFromRunLoop(_:_:_:))

Unschedules a CFNetServiceBrowser from a run loop and mode.

[`CFNetServiceCancel(_:)`](/documentation/CFNetwork/CFNetServiceCancel(_:))

Cancels a service registration or a service resolution.

[`CFNetServiceCreate(_:_:_:_:_:)`](/documentation/CFNetwork/CFNetServiceCreate(_:_:_:_:_:))

Creates an instance of a Network Service object.

[`CFNetServiceCreateCopy(_:_:)`](/documentation/CFNetwork/CFNetServiceCreateCopy(_:_:))

Creates a copy of a CFNetService object.

[`CFNetServiceCreateDictionaryWithTXTData(_:_:)`](/documentation/CFNetwork/CFNetServiceCreateDictionaryWithTXTData(_:_:))

Uses TXT record data to create a dictionary.

[`CFNetServiceCreateTXTDataWithDictionary(_:_:)`](/documentation/CFNetwork/CFNetServiceCreateTXTDataWithDictionary(_:_:))

Flattens a set of key/value pairs into a CFDataRef suitable for passing to [`CFNetServiceSetTXTData(_:_:)`](/documentation/CFNetwork/CFNetServiceSetTXTData(_:_:)).

[`CFNetServiceGetAddressing(_:)`](/documentation/CFNetwork/CFNetServiceGetAddressing(_:))

Gets the IP addressing from a CFNetService.

[`CFNetServiceGetDomain(_:)`](/documentation/CFNetwork/CFNetServiceGetDomain(_:))

Gets the domain from a CFNetService.

[`CFNetServiceGetName(_:)`](/documentation/CFNetwork/CFNetServiceGetName(_:))

Gets the name from a CFNetService.

[`CFNetServiceGetPortNumber(_:)`](/documentation/CFNetwork/CFNetServiceGetPortNumber(_:))

This function gets the port number from a CFNetService.

[`CFNetServiceGetTXTData(_:)`](/documentation/CFNetwork/CFNetServiceGetTXTData(_:))

Queries a network service for the contents of its TXT records.

[`CFNetServiceGetTargetHost(_:)`](/documentation/CFNetwork/CFNetServiceGetTargetHost(_:))

Queries a CFNetService for its target hosts.

[`CFNetServiceGetType(_:)`](/documentation/CFNetwork/CFNetServiceGetType(_:))

Gets the type from a CFNetService.

[`CFNetServiceGetTypeID()`](/documentation/CFNetwork/CFNetServiceGetTypeID())

Gets the Core Foundation type identifier for the Network Service object.

[`CFNetServiceMonitorCreate(_:_:_:_:)`](/documentation/CFNetwork/CFNetServiceMonitorCreate(_:_:_:_:))

Creates an instance of a NetServiceMonitor object that watches for record changes.

[`CFNetServiceMonitorGetTypeID()`](/documentation/CFNetwork/CFNetServiceMonitorGetTypeID())

Gets the Core Foundation type identifier for all CFNetServiceMonitor instances.

[`CFNetServiceMonitorInvalidate(_:)`](/documentation/CFNetwork/CFNetServiceMonitorInvalidate(_:))

Invalidates an instance of a Network Service monitor object.

[`CFNetServiceMonitorScheduleWithRunLoop(_:_:_:)`](/documentation/CFNetwork/CFNetServiceMonitorScheduleWithRunLoop(_:_:_:))

Schedules a CFNetServiceMonitor on a run loop.

[`CFNetServiceMonitorStart(_:_:_:)`](/documentation/CFNetwork/CFNetServiceMonitorStart(_:_:_:))

Starts monitoring.

[`CFNetServiceMonitorStop(_:_:)`](/documentation/CFNetwork/CFNetServiceMonitorStop(_:_:))

Stops a CFNetServiceMonitor.

[`CFNetServiceMonitorUnscheduleFromRunLoop(_:_:_:)`](/documentation/CFNetwork/CFNetServiceMonitorUnscheduleFromRunLoop(_:_:_:))

Unschedules a CFNetServiceMonitor from a run loop.

[`CFNetServiceRegister`](/documentation/CFNetwork/CFNetServiceRegister)

Makes a CFNetService available on the network.

[`CFNetServiceRegisterWithOptions(_:_:_:)`](/documentation/CFNetwork/CFNetServiceRegisterWithOptions(_:_:_:))

Makes a CFNetService available on the network.

[`CFNetServiceResolve`](/documentation/CFNetwork/CFNetServiceResolve)

This function updates the specified CFNetService with the IP address or addresses associated with the service. Call [`CFNetServiceGetAddressing(_:)`](/documentation/CFNetwork/CFNetServiceGetAddressing(_:)) to get the addresses.

[`CFNetServiceResolveWithTimeout(_:_:_:)`](/documentation/CFNetwork/CFNetServiceResolveWithTimeout(_:_:_:))

Gets the IP address or addresses for a CFNetService.

[`CFNetServiceSetClient(_:_:_:)`](/documentation/CFNetwork/CFNetServiceSetClient(_:_:_:))

Associates a callback function with a CFNetService or disassociates a callback function from a CFNetService.

[`CFNetServiceSetTXTData(_:_:)`](/documentation/CFNetwork/CFNetServiceSetTXTData(_:_:))

Sets the TXT record for a CFNetService.

[`CFNetServiceUnscheduleFromRunLoop(_:_:_:)`](/documentation/CFNetwork/CFNetServiceUnscheduleFromRunLoop(_:_:_:))

Unschedules a CFNetService from a run loop.

[`CFNetServiceScheduleWithRunLoop(_:_:_:)`](/documentation/CFNetwork/CFNetServiceScheduleWithRunLoop(_:_:_:))

Schedules a CFNetService on a run loop.

### Streams

[`CFReadStreamCreateForHTTPRequest(_:_:)`](/documentation/CFNetwork/CFReadStreamCreateForHTTPRequest(_:_:))

Creates a read stream for a CFHTTP request message.

[`CFReadStreamCreateForStreamedHTTPRequest(_:_:_:)`](/documentation/CFNetwork/CFReadStreamCreateForStreamedHTTPRequest(_:_:_:))

Creates a read stream for a CFHTTP request message object whose body is too long to keep in memory.

[`kCFStreamPropertyHTTPAttemptPersistentConnection`](/documentation/CFNetwork/kCFStreamPropertyHTTPAttemptPersistentConnection)

[`kCFStreamPropertyHTTPFinalRequest`](/documentation/CFNetwork/kCFStreamPropertyHTTPFinalRequest)

HTTP Final Request property. A value of type CFHTTPMessage containing the final message transmitted by the stream after all modifications (including authentication, connection policy, redirects, and so on) have been made. This property cannot be set.

[`kCFStreamPropertyHTTPFinalURL`](/documentation/CFNetwork/kCFStreamPropertyHTTPFinalURL)

HTTP Final URL property. A value of type CFURL containing the final HTTP URL. This value differs from the URL in the original HTTP request if an autoredirection occurred. This property cannot be set.

[`kCFStreamPropertyHTTPProxy`](/documentation/CFNetwork/kCFStreamPropertyHTTPProxy)

[`kCFStreamPropertyHTTPProxyHost`](/documentation/CFNetwork/kCFStreamPropertyHTTPProxyHost)

[`kCFStreamPropertyHTTPProxyPort`](/documentation/CFNetwork/kCFStreamPropertyHTTPProxyPort)

[`kCFStreamPropertyHTTPRequestBytesWrittenCount`](/documentation/CFNetwork/kCFStreamPropertyHTTPRequestBytesWrittenCount)

[`kCFStreamPropertyHTTPResponseHeader`](/documentation/CFNetwork/kCFStreamPropertyHTTPResponseHeader)

HTTP Response Header property. When copied by <doc://com.apple.documentation/documentation/CoreFoundation/CFReadStreamCopyProperty(_:_:)>, the header of an HTTP response message is returned.

[`kCFStreamPropertyHTTPSProxyHost`](/documentation/CFNetwork/kCFStreamPropertyHTTPSProxyHost)

[`kCFStreamPropertyHTTPSProxyPort`](/documentation/CFNetwork/kCFStreamPropertyHTTPSProxyPort)

[`kCFStreamPropertyHTTPShouldAutoredirect`](/documentation/CFNetwork/kCFStreamPropertyHTTPShouldAutoredirect)

HTTP Should Auto Redirect property. Set this property to `kCFBooleanTrue` to enable autoredirection; set this property to `kCFBooleanFalse` to disable autoredirection.

[`CFWriteStreamCreateWithFTPURL(_:_:)`](/documentation/CFNetwork/CFWriteStreamCreateWithFTPURL(_:_:))

Creates an FTP write stream.

[`CFReadStreamCreateWithFTPURL(_:_:)`](/documentation/CFNetwork/CFReadStreamCreateWithFTPURL(_:_:))

Creates an FTP read stream.

[`kCFStreamPropertyFTPAttemptPersistentConnection`](/documentation/CFNetwork/kCFStreamPropertyFTPAttemptPersistentConnection)

[`kCFStreamPropertyFTPFetchResourceInfo`](/documentation/CFNetwork/kCFStreamPropertyFTPFetchResourceInfo)

[`kCFStreamPropertyFTPFileTransferOffset`](/documentation/CFNetwork/kCFStreamPropertyFTPFileTransferOffset)

FTP File Transfer Offset stream property key for set and copy operations. The value of this property is a CFNumber of type `kCFNumberLongLongType` representing the file offset at which to start the transfer.

[`kCFStreamPropertyFTPPassword`](/documentation/CFNetwork/kCFStreamPropertyFTPPassword)

FTP Password stream property key for set and copy operations. A value of type CFString for storing the login password. Don’t set this property when anonymous FTP is desired.

[`kCFStreamPropertyFTPProxy`](/documentation/CFNetwork/kCFStreamPropertyFTPProxy)

FTP Proxy stream property key for set and copy operations. The property is a value of type CFDictionary that holds proxy dictionary key-value pairs. The dictionary returned by SystemConfiguration can also be set as the value of this property.

[`kCFStreamPropertyFTPProxyHost`](/documentation/CFNetwork/kCFStreamPropertyFTPProxyHost)

[`kCFStreamPropertyFTPProxyPassword`](/documentation/CFNetwork/kCFStreamPropertyFTPProxyPassword)

[`kCFStreamPropertyFTPProxyPort`](/documentation/CFNetwork/kCFStreamPropertyFTPProxyPort)

[`kCFStreamPropertyFTPProxyUser`](/documentation/CFNetwork/kCFStreamPropertyFTPProxyUser)

[`kCFStreamPropertyFTPResourceSize`](/documentation/CFNetwork/kCFStreamPropertyFTPResourceSize)

FTP Resource Size read stream property key copy operations. This property stores a CFNumber of type `kCFNumberLongLongType` representing the size of a resource in bytes.

[`kCFStreamPropertyFTPUsePassiveMode`](/documentation/CFNetwork/kCFStreamPropertyFTPUsePassiveMode)

FTP Passive Mode stream property key for set and copy operations. Set this property to `kCFBooleanTrue` to enable passive mode; set this property to `kCFBooleanFalse` to disable passive mode.

[`kCFStreamPropertyFTPUserName`](/documentation/CFNetwork/kCFStreamPropertyFTPUserName)

FTP User Name stream property key for set and copy operations. A value of type CFString for storing the login user name. Don’t set this property when anonymous FTP is desired.

[`CFSocketStreamSOCKSGetError(_:)`](/documentation/CFNetwork/CFSocketStreamSOCKSGetError(_:))

This function gets error codes in the `kCFStreamErrorDomainSOCKS` domain from the `CFStreamError` returned by a stream operation.

[`CFSocketStreamSOCKSGetErrorSubdomain(_:)`](/documentation/CFNetwork/CFSocketStreamSOCKSGetErrorSubdomain(_:))

Gets the error subdomain associated with errors in the `kCFStreamErrorDomainSOCKS` domain from the `CFStreamError` returned by a stream operation.

[`CFStreamCreatePairWithSocketToCFHost(_:_:_:_:_:)`](/documentation/CFNetwork/CFStreamCreatePairWithSocketToCFHost(_:_:_:_:_:))

Creates readable and writable streams connected to a given `CFHost` object.

[`CFStreamCreatePairWithSocketToNetService(_:_:_:_:)`](/documentation/CFNetwork/CFStreamCreatePairWithSocketToNetService(_:_:_:_:))

Creates a pair of streams for a CFNetService.

[`kCFStreamNetworkServiceType`](/documentation/CFNetwork/kCFStreamNetworkServiceType)

The type of service for the stream. Providing the service type allows the system to properly handle certain attributes of the stream, including routing and suspension behavior. Most streams do not need to set this property. See <doc://com.apple.documentation/documentation/CoreFoundation/stream-service-types> for a list of possible values.

[`kCFStreamNetworkServiceTypeBackground`](/documentation/CFNetwork/kCFStreamNetworkServiceTypeBackground)

Specifies that the stream is a background download.

[`kCFStreamNetworkServiceTypeCallSignaling`](/documentation/CFNetwork/kCFStreamNetworkServiceTypeCallSignaling)

A call signaling service.

[`kCFStreamNetworkServiceTypeVideo`](/documentation/CFNetwork/kCFStreamNetworkServiceTypeVideo)

Specifies that the stream is providing interactive video data.

[`kCFStreamNetworkServiceTypeVoIP`](/documentation/CFNetwork/kCFStreamNetworkServiceTypeVoIP)

Specifies that the stream is providing VoIP service.

[`kCFStreamNetworkServiceTypeVoice`](/documentation/CFNetwork/kCFStreamNetworkServiceTypeVoice)

Specifies that the stream is providing interactive voice data.

[`kCFStreamErrorDomainFTP`](/documentation/CFNetwork/kCFStreamErrorDomainFTP)

The error code is an FTP error code.

[`kCFStreamErrorDomainHTTP`](/documentation/CFNetwork/kCFStreamErrorDomainHTTP)

The error code is an HTTP error code.

[`kCFStreamErrorDomainMach`](/documentation/CFNetwork/kCFStreamErrorDomainMach)

The error code is a Mach error code defined in `mach/error.h`.

[`kCFStreamErrorDomainNetDB`](/documentation/CFNetwork/kCFStreamErrorDomainNetDB)

The error code is an error code defined in `netdb.h`.

[`kCFStreamErrorDomainNetServices`](/documentation/CFNetwork/kCFStreamErrorDomainNetServices)

The error code is a `CFNetService` error code. For details, see the [`CFNetServicesError`](/documentation/CFNetwork/CFNetServicesError) enumeration.

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamErrorDomainSOCKS>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamErrorDomainSSL>

[`kCFStreamErrorDomainSystemConfiguration`](/documentation/CFNetwork/kCFStreamErrorDomainSystemConfiguration)

The error code is a system configuration error code as defined in `System/ConfigurationSystemConfiguration.h`.

[`kCFStreamErrorDomainWinSock`](/documentation/CFNetwork/kCFStreamErrorDomainWinSock)

When running CFNetwork code on Windows, this domain returns error codes associated with the underlying TCP/IP stack. You should also note that non-networking errors such as `ENOMEM` are delivered through the POSIX domain. See the header `winsock2.h` for relevant error codes.

[`kCFStreamPropertyConnectionIsCellular`](/documentation/CFNetwork/kCFStreamPropertyConnectionIsCellular)

A boolean value indicating whether the stream is connected over a cellular (WWAN) interface. This is a read-only property, and is `false` until the connection has been established.

[`kCFStreamPropertyNoCellular`](/documentation/CFNetwork/kCFStreamPropertyNoCellular)

A Boolean value indicating that the connection should not be established over a cellular (WWAN) connection. This value can only be set *before* you open the stream.

[`kCFStreamPropertyProxyLocalBypass`](/documentation/CFNetwork/kCFStreamPropertyProxyLocalBypass)

Proxy Local Bypass property key.

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamPropertySOCKSPassword>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamPropertySOCKSProxy>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamPropertySOCKSProxyHost>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamPropertySOCKSProxyPort>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamPropertySOCKSUser>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamPropertySOCKSVersion>

[`kCFStreamPropertySSLContext`](/documentation/CFNetwork/kCFStreamPropertySSLContext)

[`kCFStreamPropertySSLPeerCertificates`](/documentation/CFNetwork/kCFStreamPropertySSLPeerCertificates)

SSL Peer Certificates property key for copy operations, which return a `CFArray` object containing `SecCertificateRef` objects.

[`kCFStreamPropertySSLPeerTrust`](/documentation/CFNetwork/kCFStreamPropertySSLPeerTrust)

SSL Peer Trust property key for copy operations, which return a `SecTrustRef` object containing the result of the SSL handshake.

[`kCFStreamPropertySSLSettings`](/documentation/CFNetwork/kCFStreamPropertySSLSettings)

SSL Settings property key for set operations.

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamPropertyShouldCloseNativeSocket>

[`kCFStreamPropertySocketExtendedBackgroundIdleMode`](/documentation/CFNetwork/kCFStreamPropertySocketExtendedBackgroundIdleMode)

A Boolean value to request that the system keep a socket open and delays reclaiming it when the process moves to the background.

[`kCFStreamPropertySocketRemoteHost`](/documentation/CFNetwork/kCFStreamPropertySocketRemoteHost)

The key’s value is a `CFHostRef` for the remote host if it is known. If not, its value is `NULL`.

[`kCFStreamPropertySocketRemoteNetService`](/documentation/CFNetwork/kCFStreamPropertySocketRemoteNetService)

The key’s value is a `CFNetServiceRef` for the remote network service if it is known. If not, its value is `NULL`.

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamPropertySocketSecurityLevel>

[`kCFStreamSSLAllowsAnyRoot`](/documentation/CFNetwork/kCFStreamSSLAllowsAnyRoot)

Security property key whose value indicates whether root certificates should be allowed.

[`kCFStreamSSLAllowsExpiredCertificates`](/documentation/CFNetwork/kCFStreamSSLAllowsExpiredCertificates)

Security property key whose value indicates whether expired certificates are allowed.

[`kCFStreamSSLAllowsExpiredRoots`](/documentation/CFNetwork/kCFStreamSSLAllowsExpiredRoots)

Security property whose value indicates whether expired root certificates are allowed.

[`kCFStreamSSLCertificates`](/documentation/CFNetwork/kCFStreamSSLCertificates)

Security property key whose value is a CFArray of SecCertificateRefs except for the first element in the array, which is a SecIdentityRef.

[`kCFStreamSSLIsServer`](/documentation/CFNetwork/kCFStreamSSLIsServer)

Security property key whose value indicates whether the connection is to act as a server in the SSL process.

[`kCFStreamSSLLevel`](/documentation/CFNetwork/kCFStreamSSLLevel)

Security property key whose value specifies the stream’s security level.

[`kCFStreamSSLPeerName`](/documentation/CFNetwork/kCFStreamSSLPeerName)

Security property key whose value overrides the name used for certificate verification.

[`kCFStreamSSLValidatesCertificateChain`](/documentation/CFNetwork/kCFStreamSSLValidatesCertificateChain)

Security property key whose value indicates whether the certificate chain should be validated.

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamSocketSOCKSVersion4>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamSocketSOCKSVersion5>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamSocketSecurityLevelNegotiatedSSL>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamSocketSecurityLevelNone>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamSocketSecurityLevelSSLv2>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamSocketSecurityLevelSSLv3>

  <doc://com.apple.documentation/documentation/CoreFoundation/kCFStreamSocketSecurityLevelTLSv1>

[`CFStreamErrorHTTP`](/documentation/CFNetwork/CFStreamErrorHTTP)

Error codes that a read stream for an HTTP request may return.

[`CFStreamErrorHTTPAuthentication`](/documentation/CFNetwork/CFStreamErrorHTTPAuthentication)

Authentication error codes that may be returned when trying to apply authentication to a request.

[Secure Sockets (SOCKS) Errors](/documentation/CFNetwork/1518266-secure-sockets-socks-errors)

Error codes returned by the `kCFStreamErrorDomainSOCKS` error domain.

### Reference

[CFNetwork Data Types](/documentation/CFNetwork/cfnetwork-data-types)

Callback types for various network services.

[CFNetwork Enumerations](/documentation/CFNetwork/cfnetwork-enumerations)

Enumerated values related to SOCKS.

[CFNetwork Constants](/documentation/CFNetwork/cfnetwork-constants)

Constants for use with CFNetwork.



---

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)