Skip to content

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.

Notifications You must be signed in to change notification settings

stvnwrgs/sailsio-node-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
  });

});

About

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.

Resources

Stars

Watchers

Forks

Packages

No packages published