getWebsocketConstructor
The WebSocket constructor to use: the one from
adapterOptions
, otherwise the global one
(browsers, Node.js 22+, Bun, Deno).
null
when the runtime has none.
Import
import { getWebsocketConstructor } from "@hyper-fetch/sockets"
Source
Package
Parameters
getWebsocketConstructor(adapterOptions: EmptyTypes | WebsocketAdapterOptionsType)
Parameters
| Name | Type | Description |
|---|---|---|
| adapterOptions | |
Returns
null | (url: string | URL, protocols?: string | string[]) => WebSocket

