<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWParameters/PrivacyContext",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network12NWParametersC14PrivacyContextC"
  },
  "title" : "NWParameters.PrivacyContext"
}
-->

# NWParameters.PrivacyContext

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

```
class PrivacyContext
```

## Topics

### Configuring Custom Privacy Settings

[`init(description:)`](/documentation/Network/NWParameters/PrivacyContext/init(description:))

Initializes a privacy context with a description string.

[`default`](/documentation/Network/NWParameters/PrivacyContext/default)

The privacy context that applies to all connections that do not use a custom context.

[`disableLogging()`](/documentation/Network/NWParameters/PrivacyContext/disableLogging())

Disables system logging of connection activity.

[`flushCache()`](/documentation/Network/NWParameters/PrivacyContext/flushCache())

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

### Requiring Encrypted DNS

[`requireEncryptedNameResolution(_:fallbackResolver:)`](/documentation/Network/NWParameters/PrivacyContext/requireEncryptedNameResolution(_:fallbackResolver:))

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

[`ResolverConfiguration`](/documentation/Network/NWParameters/PrivacyContext/ResolverConfiguration)

A DNS server configuration that uses TLS or HTTPS.

### Configuring Proxies

[`proxyConfigurations`](/documentation/Network/NWParameters/PrivacyContext/proxyConfigurations)

Applies proxy configurations for all connections associated with this context.

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

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

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

---

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)