kitten-socket
v1.4.4
Published
Socket made by kittens
Downloads
29
Readme
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);
}
});