Kind: Constant
Source: src/adapter/deno/websocket.ts
Part of: Adapter
Definition
tsUpgradeWebSocket<WebSocket, Deno.UpgradeWebSocketOptions>
Value
tsdefineWebSocketHelper(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
Was this page helpful?