Socket wrapper with no dependencies
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.
var socket = new Socket(4000, '127.0.0.1', {
logsDirectory : 'logs',
logsFilename : 'packets.log'
});
var socket = new Socket(4000, '127.0.0.1', {
token : 'at6k850a-cccd-421b-9acb-c676888097c0'
});
var socket = new Socket(4000, '127.0.0.1', {
onSocketRegisterFn : (packet, client, callback) => {
if (some logic) {
return callback(true);
}
callback(false);
}
});