<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/nw_privacy_context_t",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "c:@T@nw_privacy_context_t"
  },
  "title" : "nw_privacy_context_t"
}
-->

# nw_privacy_context_t

An object that defines the privacy requirements for a set of connections.

```
typealias nw_privacy_context_t = any OS_nw_privacy_context
```

## Discussion

Use *NW_DEFAULT_PRIVACY_CONTEXT* to specify the default shared privacy context that applies to all connections that do not use a custom context.

## Topics

### Configuring Custom Privacy Settings

[`nw_privacy_context_create(_:)`](/documentation/Network/nw_privacy_context_create(_:))

Initializes a privacy context with a description string.

[`nw_privacy_context_disable_logging(_:)`](/documentation/Network/nw_privacy_context_disable_logging(_:))

Disables system logging of connection activity.

[`nw_privacy_context_flush_cache(_:)`](/documentation/Network/nw_privacy_context_flush_cache(_:))

Flushes all cached data, such as TLS session state, created by connections associated with the privacy context.

### Requiring Encrypted DNS

[`nw_privacy_context_require_encrypted_name_resolution(_:_:_:)`](/documentation/Network/nw_privacy_context_require_encrypted_name_resolution(_:_:_:))

Requires that any DNS name resolution for connections associated with this context use encrypted transports, such as TLS or HTTPS.

[`nw_resolver_config_t`](/documentation/Network/nw_resolver_config_t)

A DNS server configuration that uses TLS or HTTPS.

[`nw_resolver_config_create_https(_:)`](/documentation/Network/nw_resolver_config_create_https(_:))

Initializes a DNS-over-HTTPS resolver configuration.

[`nw_resolver_config_create_tls(_:)`](/documentation/Network/nw_resolver_config_create_tls(_:))

Initializes a DNS-over-TLS resolver configuration.

[`nw_resolver_config_add_server_address(_:_:)`](/documentation/Network/nw_resolver_config_add_server_address(_:_:))

Provides a well-known DNS server address to use instead of looking up the address dynamically.

### Configuring Proxies

[`nw_privacy_context_add_proxy(_:_:)`](/documentation/Network/nw_privacy_context_add_proxy(_:_:))

Applies a proxy configuration to all connections associated with this context.

[`nw_privacy_context_clear_proxies(_:)`](/documentation/Network/nw_privacy_context_clear_proxies(_:))

Clears out any proxies added using [`nw_privacy_context_add_proxy(_:_:)`](/documentation/Network/nw_privacy_context_add_proxy(_:_:))

[`nw_proxy_config_t`](/documentation/Network/nw_proxy_config_t)

A proxy configuration for Relays, Oblivious HTTP, HTTP CONNECT, or SOCKSv5.



---

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)