---
title: "additionalHeaders(_:)"
framework: network
role: symbol
role_heading: Instance Method
path: "network/websocket/additionalheaders(_:)"
---

# additionalHeaders(_:)

Set additional HTTP header fields to be sent by the client during the WebSocket handshake.

## Declaration

```swift
func additionalHeaders(_ headers: [(name: String, value: String)]) -> WebSocket
```

## Parameters

- `headers`: An array of HTTP header field names and values.

## Discussion

Discussion This can be used for custom protocols and cookies. Multiple headers of the same name are not allowed, and the header will replaced by the most recently set value. note: This function will only take effect on WebSocket clients.
