---
id: "T:cAlgo.API.WebSocketClientOptions"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientOptions/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# WebSocketClientOptions (class)

Websocket client options.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public class WebSocketClientOptions
```

## Examples

C#:

```csharp
var options = new WebSocketClientOptions
{
    KeepAliveInterval = TimeSpan.FromSeconds(10),
    Timeout = TimeSpan.FromSeconds(30),
    SubProtocols = new[] { "json" }
};
var client = new WebSocketClient(options);
client.Connect(new Uri("wss://stream.example.com/quotes"));
```

Python:

```python
from System import Uri, TimeSpan, Array, String

options = WebSocketClientOptions()
options.KeepAliveInterval = TimeSpan.FromSeconds(10)
options.Timeout = TimeSpan.FromSeconds(30)
options.SubProtocols = Array[String](["json"])
client = WebSocketClient(options)
client.Connect(Uri("wss://stream.example.com/quotes"))
```

## Constructors

- `public WebSocketClientOptions()` — Creates WebSocketClientOptions with default values. [details](https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientOptions/Constructor/index.md)

## Properties

- `public TimeSpan KeepAliveInterval {get; set;}` — Gets or sets the WebSocket protocol keep-alive interval. Default value is set to 30 seconds. [details](https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientOptions/KeepAliveInterval/index.md)
- `public IEnumerable<string> SubProtocols {get; set;}` — Gets or sets sub-protocols to be negotiated during the WebSocket connection handshake. [details](https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientOptions/SubProtocols/index.md)
- `public TimeSpan Timeout {get; set;}` — Gets or sets the operation timeout. Default value is set to 60 seconds. [details](https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientOptions/Timeout/index.md)
- `public bool UseDefaultCredentials {get; set;}` — Gets or sets a Boolean value that indicates if default credentials should be used during WebSocket handshake. Default value is false. [details](https://help.ctrader.com/ctrader-algo/references/WebSocket/WebSocketClientOptions/UseDefaultCredentials/index.md)

