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

# init(http2RelayEndpoint:tlsOptions:additionalHTTPHeaderFields:)

Creates a configuration for a secure relay accessible only using HTTP/2.

## Declaration

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

## Parameters

- `http2RelayEndpoint`: A URL or host endpoint identifying the relay server accessible using HTTP/2.
- `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(http3RelayEndpoint:http2RelayEndpoint:tlsOptions:additionalHTTPHeaderFields:)](network/proxyconfiguration/relayhop/init(http3relayendpoint:http2relayendpoint:tlsoptions:additionalhttpheaderfields:).md)
