<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/ProxyConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network18ProxyConfigurationV"
  },
  "title" : "ProxyConfiguration"
}
-->

# ProxyConfiguration

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

```
struct ProxyConfiguration
```

## Topics

### Creating Proxy Configurations

[`init(relayHops:)`](/documentation/Network/ProxyConfiguration/init(relayHops:))

Initializes a proxy configuration with one or two relay hops.

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

A single relay server you can chain together with other servers.

[`init(httpCONNECTProxy:tlsOptions:)`](/documentation/Network/ProxyConfiguration/init(httpCONNECTProxy:tlsOptions:))

Initializes a legacy HTTP CONNECT configuration for a proxy server accessible using HTTP/1.1.

[`init(socksv5Proxy:)`](/documentation/Network/ProxyConfiguration/init(socksv5Proxy:))

Initializes a SOCKSv5 proxy configuration.

### Customizing Proxy Behavior

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

A Boolean that indicates whether or not a proxy configuration allows failover to non-proxied connections. Failover isn’t allowed by default.

[`applyCredential(username:password:)`](/documentation/Network/ProxyConfiguration/applyCredential(username:password:))

Sets a username and password to use as authentication for a proxy configuration.

### Inspecting Proxies

## Relationships

### Conforms To

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

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

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

---

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)