# Timeouts Settings

This reference covers all of Pomerium's **Timeouts Settings**:

- [Allow Websockets](#websocket-connections)
- [SPDY](#spdy)
- [Route Timeout](#route-timeout)
- [Idle Timeout](#idle-timeout)

## Websocket Connections

If set, enables proxying of websocket connections.

**Use with caution:** websockets are long-lived connections, so both the route timeout and idle timeout are automatically disabled (set to `0`) unless explicitly configured. Allowing websocket connections to the proxy could result in abuse via [DOS attacks](https://www.cloudflare.com/learning/ddos/ddos-attack-tools/slowloris/).

### How to configure

**Core:**

| **YAML**/**JSON** setting | **Type**  | **Default** |
| :------------------------ | :-------- | :---------- |
| `allow_websockets`        | `boolean` | `false`     |

### Examples

```yaml
allow_websockets: true
```

**Enterprise:**

**Kubernetes:**

| **[Annotation name](https://www.pomerium.com/docs/deploy/k8s/ingress.md#set-ingress-annotations)** | **Type** | **Default** |
| :-- | :-- | :-- |
| `allow_websockets` | `boolean`, `string` | `false` |

### Examples

```yaml
ingress.pomerium.io/allow_websockets: 'true'
```

## SPDY

If set, **SPDY** enables proxying of SPDY protocol upgrades.

### How to configure

**Core:**

| **YAML**/**JSON** setting | **Type**  | **Default** |
| :------------------------ | :-------- | :---------- |
| `allow_spdy`              | `boolean` | `false`     |

### Examples

```YAML
allow_spdy: true
```

**Enterprise:**

**Kubernetes:**

| **[Annotation name](https://www.pomerium.com/docs/deploy/k8s/ingress.md#set-ingress-annotations)** | **Type** | **Default** |
| :-- | :-- | :-- |
| `allow_spdy` | `boolean` | `false` |

### Examples

```yaml
ingress.pomerium.io/allow_spdy: 'true'
```

See [Kubernetes - Ingress Configuration](https://www.pomerium.com/docs/deploy/k8s/ingress.md) for more information.

## Route Timeout

**Route Timeout** establishes the per-route timeout value. Cannot exceed [global timeout](https://www.pomerium.com/docs/reference/global-timeouts.md) values. If unset, the route inherits the global [`default_upstream_timeout`](https://www.pomerium.com/docs/reference/global-timeouts.md) (default `30s`).

For routes with websockets enabled, or for TCP, UDP, and Kubernetes routes, the route timeout is automatically set to `0` (disabled) unless explicitly configured via this setting.

### How to configure

**Core:**

| **YAML**/**JSON** setting | **Type** | **Usage** | **Default** |
| :-- | :-- | :-- | :-- |
| `timeout` | `string` ([Go Duration](https://golang.org/pkg/time/#Duration.String) formatting) | **optional** | `30s` |

### Examples

```yaml
timeout: 30s
```

**Enterprise:**

**Kubernetes:**

| **[Annotation name](https://www.pomerium.com/docs/deploy/k8s/ingress.md#set-ingress-annotations)** | **Type** | **Usage** | **Default** |
| :-- | :-- | :-- | :-- |
| `timeout` | `string` ([Go Duration](https://golang.org/pkg/time/#Duration.String) formatting) | **optional** | `30s` |

### Examples

```yaml
ingress.pomerium.io/timeout: '30s'
```

## Idle Timeout

If you are proxying long-lived requests that employ streaming calls such as websockets or gRPC, set **Idle Timeout** to either a maximum value there may be no data exchange over a connection (recommended), or set it to unlimited (`0s`).

If `idle_timeout` is specified, and [route timeout](https://www.pomerium.com/docs/reference/routes/timeouts.md#route-timeout) is not explicitly set, then the route timeout would be unlimited (`0s`). You still may specify maximum lifetime of the connection using the route timeout value (i.e. to 1 day).

For routes with websockets enabled, or for TCP, UDP, and Kubernetes routes, the idle timeout is automatically set to `0` (disabled) unless explicitly configured via this setting.

### How to configure

**Core:**

| **YAML**/**JSON** setting | **Type** | **Usage** | **Default** |
| :-- | :-- | :-- | :-- |
| `idle_timeout` | `string` ([Go Duration](https://golang.org/pkg/time/#Duration.String) formatting) | **optional** | not set |

### Examples

```yaml
routes:
  - from: https://verify.localhost.pomerium.io
    to: http://verify:8000
    timeout: 1m
    idle_timeout: 5m
```

**Enterprise:**

**Kubernetes:**

| **[Annotation name](https://www.pomerium.com/docs/deploy/k8s/ingress.md#set-ingress-annotations)** | **Type** | **Usage** | **Default** |
| :-- | :-- | :-- | :-- |
| `idle_timeout` | `string` ([Go Duration](https://golang.org/pkg/time/#Duration.String) formatting) | **optional** | not set |

### Examples

```yaml
ingress.pomerium.io/timeout: '1m'
ingress.pomerium.io/idle_timeout: '5m'
```
