# upgradeWebSocket

**Kind:** Constant

**Source:** [`src/adapter/deno/websocket.ts`](https://github.com/honojs/hono/blob/main/src/adapter/deno/websocket.ts#L4)

**Part of:** [Adapter](subsystem-src-adapter)

## Definition

```ts
UpgradeWebSocket<WebSocket, Deno.UpgradeWebSocketOptions>
```

## Value

```ts
defineWebSocketHelper(async (c, events, options) => {
    if (c.req.header('upgrade') !== 'websocket') {
      return
    }

    // Echo the negotiated subprotocol back to the client. Browsers (e.g. Chrome)
    // reject the connection when a subprotocol was requested but the response is
    // missing the `Sec-WebSocket-Protocol` header.
    const subprotocol = c.req.header('sec-websocket-protoco…
```

## Relationships

- IMPORTS → `WSContext`
- IMPORTS → `defineWebSocketHelper`
