include username for amt direct connect in logs
KevinBK1998 committed
Jan 26, 2025 at 19:37 UTC
64c8d2c238d0703753648e2b803ea91db15c4c33
1 file changed
+5
-5
webserver.js
+5
-5
@@ -4990,7 +4990,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
4990
if (req.query.tls1only == 1) { tlsoptions.secureProtocol = 'TLSv1_method'; }
4991
ws.forwardclient = obj.tls.connect(port, node.host, tlsoptions, function () {
4992
// The TLS connection method is the same as TCP, but located a bit differently.
4993
- parent.debug('webrelay', 'TLS connected to ' + node.host + ':' + port + '.');
4993
+ parent.debug('webrelay', user.name + ' - TLS connected to ' + node.host + ':' + port + '.');
4994
ws.forwardclient.xstate = 1;
4995
ws._socket.resume();
4996
});
@@ -5003,7 +5003,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
5003
ws.forwardclient.on('data', function (data) {
5004
if (typeof data == 'string') { data = Buffer.from(data, 'binary'); }
5005
if (obj.parent.debugLevel >= 1) { // DEBUG
5006
- parent.debug('webrelaydata', 'TCP relay data from ' + node.host + ', ' + data.length + ' bytes.');
5006
+ parent.debug('webrelaydata', user.name + ' - TCP relay data from ' + node.host + ', ' + data.length + ' bytes.');
5007
//if (obj.parent.debugLevel >= 4) { Debug(4, ' ' + Buffer.from(data, 'binary').toString('hex')); }
5008
}
5009
if (ws.interceptor) { data = ws.interceptor.processAmtData(data); } // Run data thru interceptor
@@ -5018,13 +5018,13 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
5018
5019
// If the TCP connection closes, disconnect the associated web socket.
5020
ws.forwardclient.on('close', function () {
5021
- parent.debug('webrelay', 'TCP relay disconnected from ' + node.host + ':' + port + '.');
5021
+ parent.debug('webrelay', user.name + ' - TCP relay disconnected from ' + node.host + ':' + port + '.');
5022
try { ws.close(); } catch (e) { }
5023
});
5024
5025
// If the TCP connection causes an error, disconnect the associated web socket.
5026
ws.forwardclient.on('error', function (err) {
5027
- parent.debug('webrelay', 'TCP relay error from ' + node.host + ':' + port + ': ' + err);
5027
+ parent.debug('webrelay', user.name + ' - TCP relay error from ' + node.host + ':' + port + ': ' + err);
5028
try { ws.close(); } catch (e) { }
5029
});
5030
@@ -5035,7 +5035,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
5035
if (node.intelamt.tls == 0) {
5036
// A TCP connection to Intel AMT just connected, start forwarding.
5037
ws.forwardclient.connect(port, node.host, function () {
5038
- parent.debug('webrelay', 'TCP relay connected to ' + node.host + ':' + port + '.');
5038
+ parent.debug('webrelay', user.name + ' - TCP relay connected to ' + node.host + ':' + port + '.');
5039
ws.forwardclient.xstate = 1;
5040
ws._socket.resume();
5041
});