Skip to main content

Class: VrameworkUWSServer

Class representing a uWebSockets.js-based server for Vramework. This class is intended for quickly creating a uWebSockets server with the vramework handler, useful for prototyping. For production systems, it is expected that the uWS handler will be used directly or this file will be used as a template to add extra handlers (e.g., CORS).

Constructors

new VrameworkUWSServer()

new VrameworkUWSServer(
config,
singletonServices,
createSessionServices): VrameworkUWSServer

Constructs a new VrameworkUWSServer.

Parameters

config: CoreServerConfig

The configuration for the server.

singletonServices: CoreSingletonServices

The singleton services used by the server.

createSessionServices: CreateSessionServices<any, any, any>

Function to create session services for each request.

Returns

VrameworkUWSServer

Defined in

packages/servers/uws/uws-server/src/vramework-uws-server.ts:29

Properties

app

app: TemplatedApp;

The uWebSockets app instance

Defined in

packages/servers/uws/uws-server/src/vramework-uws-server.ts:18

Methods

enableCors()

enableCors(_options): void

Placeholder for enabling CORS.

Parameters

_options: any

The options to configure CORS.

Returns

void

Throws

Method not implemented.

Defined in

packages/servers/uws/uws-server/src/vramework-uws-server.ts:41


enableExitOnSigInt()

enableExitOnSigInt(): Promise<void>

Enables the server to exit gracefully when a SIGINT signal is received.

Returns

Promise<void>

Defined in

packages/servers/uws/uws-server/src/vramework-uws-server.ts:105


init()

init(): Promise<void>

Initializes the server by setting up health check and request handling routes.

Returns

Promise<void>

Defined in

packages/servers/uws/uws-server/src/vramework-uws-server.ts:48


start()

start(): Promise<void>

Starts the server and begins listening on the configured hostname and port.

Returns

Promise<void>

A promise that resolves when the server has started.

Defined in

packages/servers/uws/uws-server/src/vramework-uws-server.ts:71


stop()

stop(): Promise<void>

Stops the server by closing the listening socket.

Returns

Promise<void>

A promise that resolves when the server has stopped.

Throws

An error if the server was not correctly started.

Defined in

packages/servers/uws/uws-server/src/vramework-uws-server.ts:89