1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Cleaned up deprecation warning on NodeJS 10.x.

This commit is contained in:
Ylian Saint-Hilaire 2019-01-02 18:03:34 -08:00
parent 5d6bd55249
commit d7b60ccb07
19 changed files with 97 additions and 89 deletions

View file

@ -153,7 +153,7 @@ module.exports.CreateSwarmServer = function (parent, db, args, certificates) {
Debug(1, 'SWARM:New legacy agent connection');
socket.addListener("data", function (data) {
if (args.swarmdebug) { var buf = new Buffer(data, "binary"); console.log('SWARM <-- (' + buf.length + '):' + buf.toString('hex')); } // Print out received bytes
if (args.swarmdebug) { var buf = Buffer.from(data, "binary"); console.log('SWARM <-- (' + buf.length + '):' + buf.toString('hex')); } // Print out received bytes
socket.tag.accumulator += data;
// Detect if this is an HTTPS request, if it is, return a simple answer and disconnect. This is useful for debugging access to the MPS port.
@ -333,11 +333,11 @@ module.exports.CreateSwarmServer = function (parent, db, args, certificates) {
function Write(socket, data) {
if (args.swarmdebug) {
// Print out sent bytes
var buf = new Buffer(data, "binary");
var buf = Buffer.from(data, "binary");
console.log('SWARM --> (' + buf.length + '):' + buf.toString('hex'));
socket.write(buf);
} else {
socket.write(new Buffer(data, "binary"));
socket.write(Buffer.from(data, "binary"));
}
}