Skip to content

Socket wrapper with no dependencies

Notifications You must be signed in to change notification settings

intel44/kitten-socket

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kitten-socket

Socket wrapper with no dependencies

Set client uid

  var socket = new Socket(400, '127.0.0.1', {
    uid : 'ec02850a-cccd-470b-9acb-c63c888097c0'
  });

If no uid is provided, it will be generated by the server at the client connection.

Activate server logs

  var socket = new Socket(4000, '127.0.0.1', {
    logsDirectory : 'logs',
    logsFilename  : 'packets.log'
  });

Set server password

  var socket = new Socket(4000, '127.0.0.1', {
    token : 'at6k850a-cccd-421b-9acb-c676888097c0'
  });

Set auth function for socket server

  var socket = new Socket(4000, '127.0.0.1', {
    onSocketRegisterFn : (packet, client, callback) => {
      if (some logic) {
        return callback(true);
      }

      callback(false);
    }
  });

About

Socket wrapper with no dependencies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%