sailsjs-socket.io-client

This is a extended socket.io-client for node, that works with sailjs. It adds the handshake functionality and implements the GET POST PUT DELETE functions from sails socket.io.

npm install sailsjs-socket.io-client
1 downloads in the last day
3 downloads in the last week
10 downloads in the last month

sailsjs-socket.io-client

This is a extended socket.io-client for node, that works with sailjs. It adds the handshake functionality and implements the GET POST PUT DELETE functions from sails socket.io.

Example:

SailsIo.connect('http://127.0.0.1:1337', function (socket) {

  socket.on('connecting', function() {
    console.log('(II) Connecting to server');
  });
  socket.on('connect', function () {
    console.log('connected');

    socket.on('event', function(data){

    });

    socket.on('disconnect', function (reason) {
      console.log('(II) Disconnected from server\n');
    });

    socket.on('reconnect', function(socket){
      console.log(socket);
    });


    socket.on('reconnect_error', function (error) {
      console.log(error);
    })
  });

  socket.on('error', function (reason) {
    console.log('(EE) Error connecting to server: ' + reason);
    process.exit(code=0);
  });

});
npm loves you