nestjs-uws

1.0.11 • Public • Published

NestJS uWebSocket.js gateway adapter

Installation

npm i nestjs-uws

Usage

import { UWebSocketAdapter } from 'nestjs-uws';

const app = await NestFactory.create(ApplicationModule);
app.useWebSocketAdapter(new UWebSocketAdapter({
  port: 8099,
}));

You can't create SSL secure APP for now. You will need to use reverse-proxy to hide the websocket server behind.

Options

UWS Adapter options

Name Type
port number

Packet structure

To use the NestJS WebSocket gateway decorators you should implement the base packet structure and send any messages from the client using the next structure

{
    "event": String,
    "data": any
}

/nestjs-uws/

    Package Sidebar

    Install

    npm i nestjs-uws

    Weekly Downloads

    2

    Version

    1.0.11

    License

    MIT

    Unpacked Size

    12.5 kB

    Total Files

    19

    Last publish

    Collaborators

    • heavenlyteam