UNPKG

@nestjs/websockets

Version:

WebSockets for NestJS: gateways with message handlers, guards, pipes and interceptors, on Socket.IO or ws.

26 lines (25 loc) • 1.28 kB
import { GatewayMetadata } from './interfaces/gateway-metadata.interface.js'; import { ServerAndEventStreamsHost } from './interfaces/server-and-event-streams-host.interface.js'; import { SocketsContainer } from './sockets-container.js'; import type { ApplicationConfig } from '@nestjs/core'; export declare class SocketServerProvider { private readonly socketsContainer; private readonly applicationConfig; private readonly hasHttpServer; private readonly logger; private readonly serverOptions; constructor(socketsContainer: SocketsContainer, applicationConfig: ApplicationConfig, hasHttpServer?: boolean); scanForSocketServer<T extends GatewayMetadata = any>(options: T, port: number, gatewayName?: string): ServerAndEventStreamsHost; private createSocketServer; private isServedWithoutListener; /** * A gateway that joins a server created for another gateway is served with * the options of that gateway. A connection check of its own would never * run, and every client would reach its handlers, so the application does * not start. Other options it would lose are reported. */ private ensureOptionsApply; private decorateWithNamespace; private getServerOfNamespace; private validateNamespace; }