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

# subprotocols(_:)

Set the list of supported application protocols that will be presented to a WebSocket server during connection establishment.

## Declaration

```swift
func subprotocols(_ subprotocols: [String]) -> WebSocket
```

## Parameters

- `subprotocols`: An array of subprotocol strings.

## Discussion

Discussion note: This function will only take effect on WebSocket clients.
