# WebSocketFallbackOptions

URL: https://www.caprid.com/docs/reference/typescript/caprid/relay-websocket/interfaces/websocketfallbackoptions/

Defined in: [relay-sdks/ts/packages/relay-websocket/src/fallback.ts:16](https://github.com/caprids/relay-sdks/blob/main/ts/packages/relay-websocket/src/fallback.ts#L16)

Options for [withWebSocketFallback](https://www.caprid.com/docs/reference/typescript/caprid/relay-websocket/functions/withwebsocketfallback/).

## Properties

### onFallback?

```ts
onFallback?: (reason) => void;
```

Defined in: [relay-sdks/ts/packages/relay-websocket/src/fallback.ts:29](https://github.com/caprids/relay-sdks/blob/main/ts/packages/relay-websocket/src/fallback.ts#L29)

Called once when a connection ends up on WebSocket, with why WebTransport was not used: its handshake failed, the
WebSocket was ready first (both an error), or the runtime has no usable `WebTransport` (`undefined`). For logging;
it cannot change the outcome.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `reason` | `unknown` |

#### Returns

`void`

***

### webSocketDelayMs?

```ts
webSocketDelayMs?: number;
```

Defined in: [relay-sdks/ts/packages/relay-websocket/src/fallback.ts:23](https://github.com/caprids/relay-sdks/blob/main/ts/packages/relay-websocket/src/fallback.ts#L23)

The WebTransport dial's head start, in milliseconds: if its handshake has not completed by then, the WebSocket dial
starts too and the first to be ready carries the session. Default 250, the Connection Attempt Delay of Happy
Eyeballs (RFC 8305). 0 starts both dials at once. A WebTransport handshake that fails sooner starts the WebSocket
dial straight away.
