# @gamestdio/websocket

> WebSocket browser client with reconnect back-off feature.

Latest version **0.3.2** (published 2019-02-20) · 0 weekly downloads

## Install

```sh
npm install @gamestdio/websocket
pnpm add @gamestdio/websocket
yarn add @gamestdio/websocket
bun add @gamestdio/websocket
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2019-02-20 |
| First published | 2017-09-28 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 0 |
| Unpacked size | 112.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 64 |
| Maintainers | endel |

## Links

- npm: https://www.npmjs.com/package/@gamestdio/websocket
- Repository: https://github.com/gamestdio/websocket
- Homepage: https://github.com/gamestdio/websocket#readme
- Issues: https://github.com/gamestdio/websocket/issues
- npm.io page: https://npm.io/package/@gamestdio/websocket

## Recent versions

- 0.3.2 (latest) — 2019-02-20
- 0.3.1 — 2019-01-21
- 0.3.0 — 2019-01-21
- 0.2.8 — 2018-07-22
- 0.2.7 — 2018-06-23
- 0.2.6 — 2018-06-23
- 0.2.5 — 2018-04-01
- 0.2.4 — 2018-04-01
- 0.2.3 — 2018-03-10
- 0.2.2 — 2017-11-02
- 0.2.1 — 2017-11-02
- 0.2.0 — 2017-11-02
- 0.1.14 — 2017-09-28
- 0.1.13 — 2017-09-28

## README

# @gamestdio/websocket

WebSocket with reconnect back-off feature.

For Node.js support, you should install the `ws` module in your project.

## Usage

`WebSocketClient` behaves exactly in the same way as `WebSocket`.

It accepts an optional third parameter, which is used to configure
[backoff](https://github.com/MathieuTurcotte/node-backoff) feature.

```javascript
// fibonacci backoff strategy
var conn = new WebSocketClient('ws://' + host + ':8080', null, {
  backoff: "fibonacci"
});
```

```javascript
// exponential backoff strategy
var conn = new WebSocketClient('ws://' + host + ':8080', null, {
  backoff: "exponential"
});
```

## Event Listeners

- onclose
- onerror
- onmessage
- onopen
- onreconnect

## License

MIT

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