eio-reconnect
v0.8.0
Published
Reconnect code for engine.io-client
Downloads
4
Maintainers
Readme
engine.io client reconnect
Reconnect wrapper for engine.io-client - inspired by https://github.com/cayasso/engine.io-reconnect
Install
npm install eio-reconnect
Use
client = require 'engine.io-client'
reconnect = require 'eio-reconnect'
# Add reconnect functionality to eio
eio = reconnect client 'ws://localhost:8080'
eio.on 'reconnect', (attempts) -> console.log 'Reconnected after %d attempts', attempts
eio.on 'reconnecting', (attempts) -> console.log 'Reconnect attempt %d', attempts
eio.on 'reconnect_timeout', (time) -> console.log 'Timeout after %dms', time
eio.on 'reconnect_error', (error) -> console.log 'Error while reconnecting', error
Testing
grunt test
Contributing
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Requests