One Logo Pool Ball
Network · IOS API REFERENCE

ProxyConfiguration

struct · iOS 17.0+ · SDK 27.1

struct ProxyConfiguration

A ProxyConfiguration object stores a proxy configuration. Proxy configurations can be added to a Privacy Context to apply to connections within the context.

Members (12)

init · iOS 17.0+

init

TypeScript
static initSocksv5Proxy(socksv5Proxy: NWEndpoint): ProxyConfiguration
Swift declaration
init(socksv5Proxy: NWEndpoint)

Creates a SOCKSv5 proxy configuration. - Parameter socksv5Proxy: A host endpoint identifying the SOCKS proxy server.

get · iOS 17.0+

matchDomains

TypeScript
get matchDomains(): Array<string>
Swift declaration
var matchDomains: [String] { get set }

Define an array of domains to determine which hosts should use the proxy. If the array is empty, all domains are allowed to use the proxy other than domains listed in `excludedDomains`.

set · iOS 17.0+

matchDomains

TypeScript
set matchDomains(value: Array<string>)
Swift declaration
var matchDomains: [String] { get set }

Define an array of domains to determine which hosts should use the proxy. If the array is empty, all domains are allowed to use the proxy other than domains listed in `excludedDomains`.

get · iOS 17.0+

allowFailover

TypeScript
get allowFailover(): boolean
Swift declaration
var allowFailover: Bool { get set }

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

set · iOS 17.0+

allowFailover

TypeScript
set allowFailover(value: boolean)
Swift declaration
var allowFailover: Bool { get set }

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

method · iOS 17.0+

applyCredential

TypeScript
applyCredential(username: string, password: string): void
Swift declaration
func applyCredential(username: String, password: String)

A username and password to use as authentication for a proxy configuration. - Parameter username: A proxy username. - Parameter password: A proxy password.

get · iOS 17.0+

excludedDomains

TypeScript
get excludedDomains(): Array<string>
Swift declaration
var excludedDomains: [String] { get set }

Define an array of domains to determine which hosts should not use the proxy. If the array is empty, no domains are excluded.

set · iOS 17.0+

excludedDomains

TypeScript
set excludedDomains(value: Array<string>)
Swift declaration
var excludedDomains: [String] { get set }

Define an array of domains to determine which hosts should not use the proxy. If the array is empty, no domains are excluded.

get · iOS 17.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.

init · iOS 17.0+

init

TypeScript
static initHttpCONNECTProxyTlsOptions(httpCONNECTProxy: NWEndpoint, tlsOptions?: (NWProtocolTLS_Options) | null): ProxyConfiguration
Swift declaration
init(httpCONNECTProxy: NWEndpoint, tlsOptions: NWProtocolTLS.Options? = nil)

Creates a legacy HTTP CONNECT proxy configuration for a proxy server accessible using HTTP/1.1. This proxy will only relay TCP connections. - Parameter httpCONNECTProxy: A host endpoint identifying the proxy server accessible using HTTP/1.1. - Parameter tlsOptions: Optional TLS options to use for a TLS handshake to the relay. If no options are provided, the proxy will be accessed using cleartext HTTP.

init · iOS 17.0+

init

TypeScript
static initObliviousHTTPRelayRelayResourcePathGatewayKeyConfigMatchDomains(obliviousHTTPRelay: ProxyConfiguration_RelayHop, relayResourcePath: string, gatewayKeyConfig: ArrayBuffer, matchDomains: Array<string>): ProxyConfiguration
Swift declaration
init(obliviousHTTPRelay: ProxyConfiguration.RelayHop, relayResourcePath: String, gatewayKeyConfig: Data, matchDomains: [String])

Creates a proxy configuration to use Oblivious HTTP through a relay to a gateway. Oblivious HTTP requires setting the proxy configuration on a URLSessionConfiguration. - Parameter obliviousHTTPRelay: The Oblivious HTTP relay hop. - Parameter relayResourcePath: The HTTP path to use for requests to the Oblivious HTTP relay that will forward requests to the gateway. - Parameter gatewayKeyConfig: The key configuration for the Oblivious HTTP gateway, or a list of key configurations where each configuration is prefixed with a two-byte length in network byte order. - Parameter matchDomains: An array of domains that are allowed to be accessed via the Oblivious HTTP gateway.

init · iOS 17.0+

init

TypeScript
static initRelayHops(relayHops: Array<ProxyConfiguration_RelayHop>): ProxyConfiguration
Swift declaration
init(relayHops: [ProxyConfiguration.RelayHop])

Creates a proxy configuration with one or two secure relay hops. - Parameter relayHops: An array of proxy hops, which must contain either 1 or 2 hops

Skipped declarations

No declarations were skipped in this snapshot.

All Network types →