daviddoran / typescript-reconnecting-websocket

A small decorator for the JavaScript WebSocket API that automatically reconnects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReconnectingWebSocket

A small JavaScript library that decorates the WebSocket API to provide a WebSocket connection that will automatically reconnect if the connection is dropped.

It is API compatible, so when you have:

ws = new WebSocket('ws://....');

you can replace with:

ws = new ReconnectingWebSocket('ws://....');

Minified library with gzip compression is less than 600 bytes.

About

A small decorator for the JavaScript WebSocket API that automatically reconnects

License:MIT License


Languages

Language:TypeScript 55.6%Language:JavaScript 44.4%