---
title: "init(http3RelayEndpoint:http2RelayEndpoint:tlsOptions:additionalHTTPHeaderFields:)"
framework: network
role: symbol
role_heading: Initializer
path: "network/proxyconfiguration/relayhop/init(http3relayendpoint:http2relayendpoint:tlsoptions:additionalhttpheaderfields:)"
---

# init(http3RelayEndpoint:http2RelayEndpoint:tlsOptions:additionalHTTPHeaderFields:)

Creates a configuration for a secure relay accessible using HTTP/3, with an optional HTTP/2 fallback.

## Declaration

```swift
init(http3RelayEndpoint: NWEndpoint, http2RelayEndpoint: NWEndpoint? = nil, tlsOptions: NWProtocolTLS.Options = .init(), additionalHTTPHeaderFields: [String : String] = [:])
```

## Parameters

- `http3RelayEndpoint`: A URL or host endpoint identifying the relay server accessible using HTTP/3.
- `http2RelayEndpoint`: An optional URL or host endpoint identifying the relay server accessible using HTTP/2. This can be the same endpoint as http3RelayEndpoint.
- `tlsOptions`: The TLS options to use for the TLS handshake to the relay.
- `additionalHTTPHeaderFields`: A dictionary of additional HTTP headers to send as part of CONNECT requests to the relay.

## See Also

### Creating Relay Hops

- [init(http2RelayEndpoint:tlsOptions:additionalHTTPHeaderFields:)](network/proxyconfiguration/relayhop/init(http2relayendpoint:tlsoptions:additionalhttpheaderfields:).md)
