mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-04-15 16:38:51 -04:00
meshcore.js clean up.
This commit is contained in:
parent
13c0afbc1e
commit
8ac4281989
@ -1852,7 +1852,6 @@ function onTunnelUpgrade(response, s, head) {
|
|||||||
s.tunnel = this;
|
s.tunnel = this;
|
||||||
s.descriptorMetadata = "MeshAgent_relayTunnel";
|
s.descriptorMetadata = "MeshAgent_relayTunnel";
|
||||||
|
|
||||||
//if (this.tcpport != null || this.udpport != null)
|
|
||||||
if (require('MeshAgent').idleTimeout != null) {
|
if (require('MeshAgent').idleTimeout != null) {
|
||||||
s.setTimeout(require('MeshAgent').idleTimeout * 1000);
|
s.setTimeout(require('MeshAgent').idleTimeout * 1000);
|
||||||
s.on('timeout', function () {
|
s.on('timeout', function () {
|
||||||
@ -2045,32 +2044,11 @@ function onTunnelData(data) {
|
|||||||
if (this.httprequest.state == 0) {
|
if (this.httprequest.state == 0) {
|
||||||
// Check if this is a relay connection
|
// Check if this is a relay connection
|
||||||
if ((data == 'c') || (data == 'cr')) {
|
if ((data == 'c') || (data == 'cr')) {
|
||||||
this.httprequest.state = 1; /*sendConsoleText("Tunnel #" + this.httprequest.index + " now active", this.httprequest.sessionid);*/
|
this.httprequest.state = 1;
|
||||||
/*
|
//sendConsoleText("Tunnel #" + this.httprequest.index + " now active", this.httprequest.sessionid);
|
||||||
this.setTimeout(global._tunnelTimeout == null ? 5000 : global._tunnelTimeout); // Once we receive 'c', we will only wait the tunnel timeout (5 seconds) before we close the tunnel
|
|
||||||
this.on('timeout', function ()
|
|
||||||
{
|
|
||||||
this.end();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/*
|
|
||||||
// We received some data, so we will reset the idle timeout of the websocket
|
|
||||||
this.removeAllListeners('timeout');
|
|
||||||
|
|
||||||
if (require('MeshAgent').idleTimeout != null)
|
|
||||||
{
|
|
||||||
this.setTimeout(require('MeshAgent').idleTimeout * 1000);
|
|
||||||
this.on('timeout', function ()
|
|
||||||
{
|
|
||||||
this.ping();
|
|
||||||
this.setTimeout(require('MeshAgent').idleTimeout * 1000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Handle tunnel data
|
// Handle tunnel data
|
||||||
if (this.httprequest.protocol == 0) { // 1 = Terminal (admin), 2 = Desktop, 5 = Files, 6 = PowerShell (admin), 7 = Plugin Data Exchange, 8 = Terminal (user), 9 = PowerShell (user), 10 = FileTransfer
|
if (this.httprequest.protocol == 0) { // 1 = Terminal (admin), 2 = Desktop, 5 = Files, 6 = PowerShell (admin), 7 = Plugin Data Exchange, 8 = Terminal (user), 9 = PowerShell (user), 10 = FileTransfer
|
||||||
// Take a look at the protocol
|
// Take a look at the protocol
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user