# nestjs-uws

> NestJS UWebSocket.js adapter

Latest version **1.0.11** (published 2021-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install nestjs-uws
pnpm add nestjs-uws
yarn add nestjs-uws
bun add nestjs-uws
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2021-06-01 |
| First published | 2020-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Author | Vladislav Len |
| Maintainers | heavenlyteam |
| Keywords | nestjs, websockets, uwebsocket |

## Links

- npm: https://www.npmjs.com/package/nestjs-uws
- Repository: https://github.com/heavenlyteam/nestjs-uws
- Homepage: https://github.com/heavenlyteam/nestjs-uws#readme
- Issues: https://github.com/heavenlyteam/nestjs-uws/issues
- npm.io page: https://npm.io/package/nestjs-uws

## Dependencies (3)

- [rxjs](https://npm.io/package/rxjs.md) ^6.6.0
- [uwebsockets.js](https://npm.io/package/uwebsockets.js.md) ^19.0.0-docs
- [@nestjs/websockets](https://npm.io/package/@nestjs/websockets.md) ^7.4.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2021-06-01
- 1.0.8 — 2021-06-01
- 1.0.7 — 2020-08-03
- 1.0.10 — 2020-07-30
- 1.0.9 — 2020-07-30
- 1.0.6 — 2020-07-30
- 1.0.0 — 2020-07-30

## README

<h1 align="center"></h1>

<div align="center">
  <a href="http://nestjs.com/" target="_blank">
    <img src="https://nestjs.com/img/logo_text.svg" width="150" alt="Nest Logo" />
  </a>
  
  <a href="https://github.com/uNetworking/uWebSockets.js" target="_blank">
      <img src="https://raw.githubusercontent.com/uNetworking/uWebSockets/master/misc/logo.svg" width="100" alt="Nest Logo" />
    </a>
</div>

<h3 align="center">NestJS uWebSocket.js gateway adapter</h3>

<div align="center">
  <img src="https://github.com/heavenlyteam/nestjs-uws/workflows/Build/badge.svg" alt="">
</div>

### Installation

```bash
npm i nestjs-uws
```

### Usage

```typescript
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

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

---
_Source: https://npm.io/package/nestjs-uws · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
