Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Ideolys/kitten-socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 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

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •