Skip to content

Documents for @litert/websocket / Decl / IRejectOptions

Interface: IRejectOptions ​

Defined in: src/lib/Decl.ts:190

The options for IServer.reject() method.

Properties ​

body? ​

optional body: string | Buffer<ArrayBufferLike>

Defined in: src/lib/Decl.ts:221

The entity body of the response to reject the websocket request.


headers? ​

optional headers: OutgoingHttpHeaders

Defined in: src/lib/Decl.ts:216

The extra HTTP header of the response to reject the websocket request.


request ​

request: IncomingMessage

Defined in: src/lib/Decl.ts:195

The HTTP request object for the websocket handshake request.


socket ​

socket: Socket

Defined in: src/lib/Decl.ts:204

The TCP socket for the websocket connection.

For the socket parameter from upgrade event of http.Server object, you may need to force-cast it to Net.Socket type (although it is actually a Net.Socket object indeed), because its type is not equitable in TypeScript.


statusCode? ​

optional statusCode: number

Defined in: src/lib/Decl.ts:211

The HTTP status code of the response to reject the websocket request.

Default ​

ts
400