Skip to main content

Interface: RequestWS

Defined in: service-core/src/http/uWS/WebSocket.ts:16

HTTP request type for handling WebSocket upgrade requests. Extends HttpRequest with WebSocket-specific properties set by the router after the WebSocket connection is opened.

Extends​

Indexable​

[key: string]: any

Allow arbitrary per-request properties (e.g. req.websocket, req.wsHandled).

Properties​

authPayload?​

optional authPayload?: any

Defined in: service-core/src/http/types.ts:59

Full decoded JWT payload, set by JWT auth middleware.

Inherited from​

HttpRequest.authPayload


authToken?​

optional authToken?: string

Defined in: service-core/src/http/types.ts:61

Raw JWT token string, set by JWT auth middleware.

Inherited from​

HttpRequest.authToken


body​

body: any

Defined in: service-core/src/http/types.ts:20

Inherited from​

HttpRequest.body


bodyStream?​

optional bodyStream?: Readable

Defined in: service-core/src/http/types.ts:40

The raw request body as a Node Readable stream, populated instead of body/rawBody for a route registered with { streamingBody: true } (see HttpRouteOptions) — e.g. via the @StreamingBody() decorator. undefined for every ordinary route, where body/rawBody are populated as before.

The stream yields Buffer chunks and supports for await (const chunk of req.bodyStream) as well as .pipe(). Backpressure is enforced end-to-end by both adapters — a slow consumer throttles how fast bytes are read off the underlying connection rather than buffering unbounded data in memory — which is the entire point of opting into streaming (e.g. a multi-GB file upload). The stream is destroyed (with an error) if the client disconnects mid-upload; a handler consuming it via for await sees that as a thrown error and should clean up (e.g. delete a partially-written temp file) in a catch/finally.

A streaming route does NOT get the framework's default maxBodySize enforcement — that check only runs as part of the ordinary buffering path. The handler is responsible for enforcing whatever size limit makes sense for the route itself.

Inherited from​

HttpRequest.bodyStream


cookies​

cookies: Record<string, string>

Defined in: service-core/src/http/types.ts:41

Inherited from​

HttpRequest.cookies


headers​

headers: Record<string, string | string[] | undefined>

Defined in: service-core/src/http/types.ts:17

Inherited from​

HttpRequest.headers


method​

method: string

Defined in: service-core/src/http/types.ts:14

Inherited from​

HttpRequest.method


params​

params: Record<string, string>

Defined in: service-core/src/http/types.ts:18

Inherited from​

HttpRequest.params


path​

path: string

Defined in: service-core/src/http/types.ts:15

Inherited from​

HttpRequest.path


query​

query: Record<string, string | string[]>

Defined in: service-core/src/http/types.ts:19

Inherited from​

HttpRequest.query


rawBody?​

optional rawBody?: Buffer<ArrayBufferLike>

Defined in: service-core/src/http/types.ts:21

Inherited from​

HttpRequest.rawBody


routePattern?​

optional routePattern?: string

Defined in: service-core/src/http/types.ts:68

The registered route pattern that matched this request (e.g. /items/:id), set by the router before any middleware runs. undefined when no application route matched, i.e. the request is handled by the router's own not-found or CORS preflight fallback. Unlike path, the set of possible values is bounded by the application's routes, so it is safe to use as a metrics label.

Inherited from​

HttpRequest.routePattern


session?​

optional session?: Record<string, any>

Defined in: service-core/src/http/types.ts:47

Populated by the optional session middleware (see SessionManager). Undefined when no session middleware is registered (i.e. the session config block is absent).

Inherited from​

HttpRequest.session


sessionIsNew?​

optional sessionIsNew?: boolean

Defined in: service-core/src/http/types.ts:53

Set by the session middleware. true when session is not backed by a stored session yet (the request carried no valid session cookie): nothing is stored and no cookie is sent unless a handler writes to session. Bookkeeping-only writes (last access time, IP address, ...) should be skipped while this is true.

Inherited from​

HttpRequest.sessionIsNew


signedCookies​

signedCookies: Record<string, string>

Defined in: service-core/src/http/types.ts:42

Inherited from​

HttpRequest.signedCookies


socket​

socket: object

Defined in: service-core/src/http/types.ts:55

Minimal socket interface; populated with remote address for IP extraction.

remoteAddress?​

optional remoteAddress?: string

Inherited from​

HttpRequest.socket


url​

url: string

Defined in: service-core/src/http/types.ts:16

Inherited from​

HttpRequest.url


user?​

optional user?: JWTUser

Defined in: service-core/src/http/types.ts:57

Set by JWT auth middleware after successful token verification.

Inherited from​

HttpRequest.user


websocket​

websocket: IWebSocketShim | undefined

Defined in: service-core/src/http/uWS/WebSocket.ts:20

The WebSocket shim for this connection. Set on open after the upgrade.


wsHandled​

wsHandled: boolean

Defined in: service-core/src/http/uWS/WebSocket.ts:27

Indicates that the WebSocket handler has processed this connection and the connection should remain open. Set to true by wrapMiddleware when a decorated handler returns successfully.