reconnet-ws
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@gamestdio/websocket

WebSocket browser client with reconnect back-off feature.

Usage

WebSocketClient behaves exactly in the same way as WebSocket.

It accepts an optional third parameter, which is used to configure backoff feature.

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

Event Listeners

  • onclose
  • onerror
  • onmessage
  • onopen
  • onreconnect

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i reconnet-ws

Weekly Downloads

9

Version

1.0.3

License

none

Unpacked Size

115 kB

Total Files

9

Last publish

Collaborators

  • fortranlee