Documents for @litert/websocket / Decl / IServer
Interface: IServer
Defined in: src/lib/Decl.ts:57
The interface of websocket server.
Properties
frameReceiveMode
readonlyframeReceiveMode:EFrameReceiveMode
Defined in: src/lib/Decl.ts:84
The mode of receiving frames.
Default
EFrameReceiveMode.STANDARDmaxMessageSize
maxMessageSize:
number
Defined in: src/lib/Decl.ts:77
The maximum size of each message body.
Changing this value will not affect the existing connections.
Default
67108864 (64 MiB)See
DEFAULT_MAX_MESSAGE_SIZE
timeout
timeout:
number
Defined in: src/lib/Decl.ts:67
The timeout in milliseconds for the new connections.
Set to
0to disable the timeout.
Default
60000Methods
accept()
accept(
opts):IWebSocket
Defined in: src/lib/Decl.ts:89
Accept the websocket request.
Parameters
opts
Returns
isWebSocketRequest()
isWebSocketRequest(
req):boolean
Defined in: src/lib/Decl.ts:99
Tell if the request is a websocket request.
Parameters
req
IncomingMessage
Returns
boolean
reject()
reject(
opts):void
Defined in: src/lib/Decl.ts:94
Reject the websocket request.
Parameters
opts
Returns
void