# Server::Options

<a id="options-17"></a>

# Options

```cpp
#include <icy/symple/server.h>

struct Options
```

[Defined in src/symple/include/icy/symple/server.h:140](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L140)

[Configuration](https://auscaster.com/icey/docs/api-reference/icy-Configuration.md#configuration) options for the Symple server.

## Public Attributes

| Return | Name | Description |
|--------|------|-------------|
| `std::string` | [`host`](#host-4)  |  |
| `uint16_t` | [`port`](#port-3)  |  |
| [`net::TCPSocket::Ptr`](https://auscaster.com/icey/docs/api-reference/icy-net-TCPSocket.md#ptr-14) | [`socket`](#socket-8)  | Optional pre-created listen socket (e.g. SSLSocket for HTTPS/WSS). |
| `bool` | [`authentication`](#authentication)  | Require token in auth message. |
| `bool` | [`dynamicRooms`](#dynamicrooms)  | Allow clients to join/leave rooms. |
| `bool` | [`enforceOrigin`](#enforceorigin)  | Enforce WebSocket Origin checks before accepting browser upgrades. |
| `bool` | [`allowSameOrigin`](#allowsameorigin)  | Allow Origin matching the request Host and originScheme. |
| `std::string` | [`originScheme`](#originscheme)  | Scheme used for same-origin checks ("http" or "https"). |
| `std::vector< std::string >` | [`allowedOrigins`](#allowedorigins)  | Additional exact Origin values to allow. |
| `size_t` | [`maxConnections`](#maxconnections)  | Max WebSocket connections (0 = unlimited) |
| `size_t` | [`maxMessageSize`](#maxmessagesize-1)  | Max message payload in bytes (64KB default) |
| `double` | [`rateLimit`](#ratelimit)  | Messages per rate window. |
| `double` | [`rateSeconds`](#rateseconds)  | Rate window in seconds. |

---

<a id="host-4"></a>

### host

```cpp
std::string host = "0.0.0.0"
```

[Defined in src/symple/include/icy/symple/server.h:142](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L142)

---

<a id="port-3"></a>

### port

```cpp
uint16_t port = 4500
```

[Defined in src/symple/include/icy/symple/server.h:143](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L143)

---

<a id="socket-8"></a>

### socket

```cpp
net::TCPSocket::Ptr socket
```

Type: [`net::TCPSocket::Ptr`](https://auscaster.com/icey/docs/api-reference/icy-net-TCPSocket.md#ptr-14)

[Defined in src/symple/include/icy/symple/server.h:144](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L144)

Optional pre-created listen socket (e.g. SSLSocket for HTTPS/WSS).

---

<a id="authentication"></a>

### authentication

```cpp
bool authentication = false
```

[Defined in src/symple/include/icy/symple/server.h:145](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L145)

Require token in auth message.

---

<a id="dynamicrooms"></a>

### dynamicRooms

```cpp
bool dynamicRooms = true
```

[Defined in src/symple/include/icy/symple/server.h:146](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L146)

Allow clients to join/leave rooms.

---

<a id="enforceorigin"></a>

### enforceOrigin

```cpp
bool enforceOrigin = false
```

[Defined in src/symple/include/icy/symple/server.h:147](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L147)

Enforce WebSocket Origin checks before accepting browser upgrades.

---

<a id="allowsameorigin"></a>

### allowSameOrigin

```cpp
bool allowSameOrigin = true
```

[Defined in src/symple/include/icy/symple/server.h:148](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L148)

Allow Origin matching the request Host and originScheme.

---

<a id="originscheme"></a>

### originScheme

```cpp
std::string originScheme = "http"
```

[Defined in src/symple/include/icy/symple/server.h:149](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L149)

Scheme used for same-origin checks ("http" or "https").

---

<a id="allowedorigins"></a>

### allowedOrigins

```cpp
std::vector< std::string > allowedOrigins
```

[Defined in src/symple/include/icy/symple/server.h:150](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L150)

Additional exact Origin values to allow.

---

<a id="maxconnections"></a>

### maxConnections

```cpp
size_t maxConnections = 1024
```

[Defined in src/symple/include/icy/symple/server.h:153](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L153)

Max WebSocket connections (0 = unlimited)

---

<a id="maxmessagesize-1"></a>

### maxMessageSize

```cpp
size_t maxMessageSize = 64 * 1024
```

[Defined in src/symple/include/icy/symple/server.h:154](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L154)

Max message payload in bytes (64KB default)

---

<a id="ratelimit"></a>

### rateLimit

```cpp
double rateLimit = 100.0
```

[Defined in src/symple/include/icy/symple/server.h:155](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L155)

Messages per rate window.

---

<a id="rateseconds"></a>

### rateSeconds

```cpp
double rateSeconds = 10.0
```

[Defined in src/symple/include/icy/symple/server.h:156](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/server.h#L156)

Rate window in seconds.
