Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

stable-socket

ystskm94MIT1.0.3

Auto reconnect, multiple boundary socket connector.

util, WebSocket, EventSource

readme

stable-socket

Version Build status

Install

Install with npm:

npm install stable-socket

API - Set WebSocket, candidate hosts and options

    var socket = new StableSocket(require('websockets').WebSocket, 
      ['http://localhost:8000/', 'http://localhost:8001/']
      {});
    socket.onopen = function() { console.log('Socket opened!') };
    socket.send('Hello!');
    // => 'Socket opened!'

also use on browser

<script type="text/javascript" src="StableSocket.js"></script>
<script type="text/javascript">

    var socket = new StableSocket(WebSocket, 
      ['http://localhost:8000/', 'http://localhost:8001/']
      {});
    socket.onopen = function() { console.log('Socket opened!') };
    socket.send('Hello!');
    // => 'Socket opened!'

</script>