mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Improved file transfers, added file downloads over WebRTC.
This commit is contained in:
parent
2a835d25cd
commit
0c3c0973bc
28 changed files with 579 additions and 230 deletions
|
@ -83,9 +83,9 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
}
|
||||
}
|
||||
|
||||
obj.Send = function (x) {
|
||||
obj.send = function (x) {
|
||||
//console.log("KSend(" + x.length + "): " + rstr2hex(x));
|
||||
obj.parent.Send(x);
|
||||
obj.parent.send(x);
|
||||
}
|
||||
|
||||
// KVM Control.
|
||||
|
@ -138,24 +138,24 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
obj.SendUnPause = function () {
|
||||
//obj.Debug("SendUnPause");
|
||||
//obj.xxStateChange(3);
|
||||
obj.Send(String.fromCharCode(0x00, 0x08, 0x00, 0x05, 0x00));
|
||||
obj.send(String.fromCharCode(0x00, 0x08, 0x00, 0x05, 0x00));
|
||||
}
|
||||
|
||||
obj.SendPause = function () {
|
||||
//obj.Debug("SendPause");
|
||||
//obj.xxStateChange(2);
|
||||
obj.Send(String.fromCharCode(0x00, 0x08, 0x00, 0x05, 0x01));
|
||||
obj.send(String.fromCharCode(0x00, 0x08, 0x00, 0x05, 0x01));
|
||||
}
|
||||
|
||||
obj.SendCompressionLevel = function (type, level, scaling, frametimer) {
|
||||
if (level) { obj.CompressionLevel = level; }
|
||||
if (scaling) { obj.ScalingLevel = scaling; }
|
||||
if (frametimer) { obj.FrameRateTimer = frametimer; }
|
||||
obj.Send(String.fromCharCode(0x00, 0x05, 0x00, 0x0A, type, obj.CompressionLevel) + obj.shortToStr(obj.ScalingLevel) + obj.shortToStr(obj.FrameRateTimer));
|
||||
obj.send(String.fromCharCode(0x00, 0x05, 0x00, 0x0A, type, obj.CompressionLevel) + obj.shortToStr(obj.ScalingLevel) + obj.shortToStr(obj.FrameRateTimer));
|
||||
}
|
||||
|
||||
obj.SendRefresh = function () {
|
||||
obj.Send(String.fromCharCode(0x00, 0x06, 0x00, 0x04));
|
||||
obj.send(String.fromCharCode(0x00, 0x06, 0x00, 0x04));
|
||||
}
|
||||
|
||||
obj.ProcessScreenMsg = function (width, height) {
|
||||
|
@ -214,7 +214,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
obj.SendKeyMsgKC(obj.KeyAction.UP, 91); // Left-Windows
|
||||
obj.SendKeyMsgKC(obj.KeyAction.UP, 92); // Right-Windows
|
||||
obj.SendKeyMsgKC(obj.KeyAction.UP, 16); // Shift
|
||||
obj.Send(String.fromCharCode(0x00, 0x0E, 0x00, 0x04));
|
||||
obj.send(String.fromCharCode(0x00, 0x0E, 0x00, 0x04));
|
||||
break;
|
||||
case 11: // GetDisplays
|
||||
var myOptions = [], dcount = ((str.charCodeAt(4) & 0xFF) << 8) + (str.charCodeAt(5) & 0xFF);
|
||||
|
@ -268,21 +268,21 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
}
|
||||
|
||||
obj.SendMessage = function (msg) {
|
||||
if (obj.State == 3) obj.Send(String.fromCharCode(0x00, 0x11) + obj.shortToStr(4 + msg.length) + msg); // 0x11 = 17 MNG_KVM_MESSAGE
|
||||
if (obj.State == 3) obj.send(String.fromCharCode(0x00, 0x11) + obj.shortToStr(4 + msg.length) + msg); // 0x11 = 17 MNG_KVM_MESSAGE
|
||||
}
|
||||
|
||||
obj.SendKeyMsgKC = function (action, kc) {
|
||||
if (obj.State == 3) obj.Send(String.fromCharCode(0x00, obj.InputType.KEY, 0x00, 0x06, (action - 1), kc));
|
||||
if (obj.State == 3) obj.send(String.fromCharCode(0x00, obj.InputType.KEY, 0x00, 0x06, (action - 1), kc));
|
||||
}
|
||||
|
||||
obj.sendcad = function() { obj.SendCtrlAltDelMsg(); }
|
||||
|
||||
obj.SendCtrlAltDelMsg = function () {
|
||||
if (obj.State == 3) { obj.Send(String.fromCharCode(0x00, obj.InputType.CTRLALTDEL, 0x00, 0x04)); }
|
||||
if (obj.State == 3) { obj.send(String.fromCharCode(0x00, obj.InputType.CTRLALTDEL, 0x00, 0x04)); }
|
||||
}
|
||||
|
||||
obj.SendEscKey = function () {
|
||||
if (obj.State == 3) obj.Send(String.fromCharCode(0x00, obj.InputType.KEY, 0x00, 0x06, 0x00, 0x1B, 0x00, obj.InputType.KEY, 0x00, 0x06, 0x01, 0x1B));
|
||||
if (obj.State == 3) obj.send(String.fromCharCode(0x00, obj.InputType.KEY, 0x00, 0x06, 0x00, 0x1B, 0x00, obj.InputType.KEY, 0x00, 0x06, 0x01, 0x1B));
|
||||
}
|
||||
|
||||
obj.SendStartMsg = function () {
|
||||
|
@ -298,7 +298,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
}
|
||||
|
||||
obj.SendTouchMsg1 = function (id, flags, x, y) {
|
||||
if (obj.State == 3) obj.Send(String.fromCharCode(0x00, obj.InputType.TOUCH) + obj.shortToStr(14) + String.fromCharCode(0x01, id) + obj.intToStr(flags) + obj.shortToStr(x) + obj.shortToStr(y));
|
||||
if (obj.State == 3) obj.send(String.fromCharCode(0x00, obj.InputType.TOUCH) + obj.shortToStr(14) + String.fromCharCode(0x01, id) + obj.intToStr(flags) + obj.shortToStr(x) + obj.shortToStr(y));
|
||||
}
|
||||
|
||||
obj.SendTouchMsg2 = function (id, flags) {
|
||||
|
@ -314,7 +314,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
msg += String.fromCharCode(k) + obj.intToStr(flags2) + obj.shortToStr(obj.TouchArray[k].x) + obj.shortToStr(obj.TouchArray[k].y);
|
||||
if (obj.TouchArray[k].f == 2) delete obj.TouchArray[k];
|
||||
}
|
||||
if (obj.State == 3) obj.Send(String.fromCharCode(0x00, obj.InputType.TOUCH) + obj.shortToStr(5 + msg.length) + String.fromCharCode(0x02) + msg);
|
||||
if (obj.State == 3) obj.send(String.fromCharCode(0x00, obj.InputType.TOUCH) + obj.shortToStr(5 + msg.length) + String.fromCharCode(0x02) + msg);
|
||||
if (Object.keys(obj.TouchArray).length == 0 && obj.touchtimer != null) { clearInterval(obj.touchtimer); obj.touchtimer = null; }
|
||||
}
|
||||
|
||||
|
@ -342,13 +342,13 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||
var MouseMsg = "";
|
||||
if (Action == obj.KeyAction.SCROLL) MouseMsg = String.fromCharCode(0x00, obj.InputType.MOUSE, 0x00, 0x0C, 0x00, ((Action == obj.KeyAction.DOWN) ? Button : ((Button * 2) & 0xFF)), ((X / 256) & 0xFF), (X & 0xFF), ((Y / 256) & 0xFF), (Y & 0xFF), ((Delta / 256) & 0xFF), (Delta & 0xFF));
|
||||
else MouseMsg = String.fromCharCode(0x00, obj.InputType.MOUSE, 0x00, 0x0A, 0x00, ((Action == obj.KeyAction.DOWN) ? Button : ((Button * 2) & 0xFF)), ((X / 256) & 0xFF), (X & 0xFF), ((Y / 256) & 0xFF), (Y & 0xFF));
|
||||
if (obj.Action == obj.KeyAction.NONE) { if (obj.Alternate == 0 || obj.ipad) { obj.Send(MouseMsg); obj.Alternate = 1; } else { obj.Alternate = 0; } } else { obj.Send(MouseMsg); }
|
||||
if (obj.Action == obj.KeyAction.NONE) { if (obj.Alternate == 0 || obj.ipad) { obj.send(MouseMsg); obj.Alternate = 1; } else { obj.Alternate = 0; } } else { obj.send(MouseMsg); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
obj.GetDisplayNumbers = function () { obj.Send(String.fromCharCode(0x00, 0x0B, 0x00, 0x04)); } // Get Terminal display
|
||||
obj.SetDisplay = function (number) { obj.Send(String.fromCharCode(0x00, 0x0C, 0x00, 0x06, number >> 8, number & 0xFF)); } // Set Terminal display
|
||||
obj.GetDisplayNumbers = function () { obj.send(String.fromCharCode(0x00, 0x0B, 0x00, 0x04)); } // Get Terminal display
|
||||
obj.SetDisplay = function (number) { obj.send(String.fromCharCode(0x00, 0x0C, 0x00, 0x06, number >> 8, number & 0xFF)); } // Set Terminal display
|
||||
obj.intToStr = function (x) { return String.fromCharCode((x >> 24) & 0xFF, (x >> 16) & 0xFF, (x >> 8) & 0xFF, x & 0xFF); }
|
||||
obj.shortToStr = function (x) { return String.fromCharCode((x >> 8) & 0xFF, x & 0xFF); }
|
||||
|
||||
|
|
|
@ -10,18 +10,19 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
obj.m = module; // This is the inner module (Terminal or Desktop)
|
||||
module.parent = obj;
|
||||
obj.meshserver = meshserver;
|
||||
obj.nodeid = null;
|
||||
obj.State = 0;
|
||||
obj.nodeid = null;
|
||||
obj.socket = null;
|
||||
obj.connectstate = -1;
|
||||
obj.tunnelid = Math.random().toString(36).substring(2); // Generate a random client tunnel id
|
||||
obj.protocol = module.protocol; // 1 = SOL, 2 = KVM, 3 = IDER, 4 = Files, 5 = FileTransfer
|
||||
obj.onStateChanged = null;
|
||||
obj.ctrlMsgAllowed = true;
|
||||
obj.attemptWebRTC = false;
|
||||
obj.webRtcActive = false;
|
||||
obj.webSwitchOk = false;
|
||||
obj.webrtc = null;
|
||||
obj.webchannel = null;
|
||||
obj.onStateChanged = null;
|
||||
obj.webrtc = null;
|
||||
obj.debugmode = 0;
|
||||
|
||||
// Private method
|
||||
|
@ -38,8 +39,8 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
obj.socket.onerror = function (e) { console.error(e); }
|
||||
obj.socket.onclose = obj.xxOnSocketClosed;
|
||||
obj.xxStateChange(1);
|
||||
//obj.meshserver.Send({ action: 'msg', type: 'tunnel', nodeid: obj.nodeid, value: url2 });
|
||||
obj.meshserver.Send({ action: 'msg', type: 'tunnel', nodeid: obj.nodeid, value: "*/meshrelay.ashx?id=" + obj.tunnelid });
|
||||
//obj.meshserver.send({ action: 'msg', type: 'tunnel', nodeid: obj.nodeid, value: url2 });
|
||||
obj.meshserver.send({ action: 'msg', type: 'tunnel', nodeid: obj.nodeid, value: "*/meshrelay.ashx?id=" + obj.tunnelid });
|
||||
//obj.debug("Agent Redir Start: " + url);
|
||||
}
|
||||
|
||||
|
@ -53,6 +54,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
obj.xxOnControlCommand = function (msg) {
|
||||
var controlMsg;
|
||||
try { controlMsg = JSON.parse(msg); } catch (e) { return; }
|
||||
if (controlMsg.ctrlChannel != '102938') { obj.xxOnSocketData(msg); return; }
|
||||
//console.log(controlMsg);
|
||||
if (obj.webrtc != null) {
|
||||
if (controlMsg.type == 'answer') {
|
||||
|
@ -61,16 +63,19 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
obj.webSwitchOk = true; // Other side is ready for switch over
|
||||
performWebRtcSwitch();
|
||||
} else if (controlMsg.type == 'webrtc1') {
|
||||
obj.socket.send("{\"type\":\"webrtc2\"}"); // Confirm we got end of data marker, indicates data will no longer be received on websocket.
|
||||
sendCtrlMsg("{\"ctrlChannel\":\"102938\",\"type\":\"webrtc2\"}"); // Confirm we got end of data marker, indicates data will no longer be received on websocket.
|
||||
} else if (controlMsg.type == 'webrtc2') {
|
||||
// TODO: Resume/Start sending data over WebRTC
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sendCtrlMsg(x) { if (obj.ctrlMsgAllowed == true) { try { obj.socket.send(x); } catch (e) { } } }
|
||||
|
||||
function performWebRtcSwitch() {
|
||||
if ((obj.webSwitchOk == true) && (obj.webRtcActive == true)) {
|
||||
obj.socket.send("{\"type\":\"webrtc1\"}"); // Indicate to the other side that data traffic will no longer be sent over websocket.
|
||||
sendCtrlMsg("{\"ctrlChannel\":\"102938\",\"type\":\"webrtc0\"}"); // Indicate to the meshagent that it can start traffic switchover
|
||||
sendCtrlMsg("{\"ctrlChannel\":\"102938\",\"type\":\"webrtc1\"}"); // Indicate to the meshagent that data traffic will no longer be sent over websocket.
|
||||
// TODO: Hold/Stop sending data over websocket
|
||||
if (obj.onStateChanged != null) { obj.onStateChanged(obj, obj.State); }
|
||||
}
|
||||
|
@ -78,7 +83,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
|
||||
// Close the WebRTC connection, should be called if a problem occurs during WebRTC setup.
|
||||
obj.xxCloseWebRTC = function () {
|
||||
try { obj.webchannel.send("{\"type\":\"close\"}"); } catch (e) { }
|
||||
sendCtrlMsg("{\"ctrlChannel\":\"102938\",\"type\":\"close\"}");
|
||||
if (obj.webchannel != null) { try { obj.webchannel.close(); } catch (e) { } obj.webchannel = null; }
|
||||
if (obj.webrtc != null) { try { obj.webrtc.close(); } catch (e) { } obj.webrtc = null; }
|
||||
obj.webRtcActive = false;
|
||||
|
@ -86,6 +91,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
|
||||
obj.xxOnMessage = function (e) {
|
||||
//if (obj.debugmode == 1) { console.log('Recv', e.data); }
|
||||
//console.log('Recv', e.data, obj.State);
|
||||
if (obj.State < 3) {
|
||||
if (e.data == 'c') {
|
||||
obj.socket.send(obj.protocol);
|
||||
|
@ -120,7 +126,6 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
}, obj.xxCloseWebRTC, { mandatory: { OfferToReceiveAudio: false, OfferToReceiveVideo: false } });
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -169,9 +174,9 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
return obj.m.ProcessData(data);
|
||||
}
|
||||
|
||||
obj.Send = function (x) {
|
||||
obj.send = function (x) {
|
||||
//obj.debug("Agent Redir Send(" + obj.webRtcActive + ", " + x.length + "): " + rstr2hex(x));
|
||||
//console.log("Agent Redir Send(" + obj.webRtcActive + ", " + x.length + "): " + rstr2hex(x));
|
||||
//console.log("Agent Redir Send(" + obj.webRtcActive + ", " + x.length + "): " + ((typeof x == 'string')?x:rstr2hex(x)));
|
||||
if (obj.socket != null && obj.socket.readyState == WebSocket.OPEN) {
|
||||
if (typeof x == 'string') {
|
||||
if (obj.debugmode == 1) {
|
||||
|
@ -210,7 +215,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
|
|||
obj.connectstate = -1;
|
||||
obj.xxCloseWebRTC();
|
||||
if (obj.socket != null) {
|
||||
try { if (obj.socket.readyState == 1) { obj.socket.send("{\"type\":\"close\"}"); obj.socket.close(); } } catch (e) { }
|
||||
try { if (obj.socket.readyState == 1) { sendCtrlMsg("{\"ctrlChannel\":\"102938\",\"type\":\"close\"}"); obj.socket.close(); } } catch (e) { }
|
||||
obj.socket = null;
|
||||
}
|
||||
obj.xxStateChange(0);
|
||||
|
|
|
@ -81,19 +81,19 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
|||
//var version = parseFloat(obj.acc.substring(4, 11));
|
||||
//obj.Debug("KVersion: " + version);
|
||||
obj.state = 1;
|
||||
obj.Send("RFB 003.008\n");
|
||||
obj.send("RFB 003.008\n");
|
||||
}
|
||||
else if (obj.state == 1 && obj.acc.length >= 1) {
|
||||
// Getting security options
|
||||
cmdsize = obj.acc.charCodeAt(0) + 1;
|
||||
obj.Send(String.fromCharCode(1)); // Send the "None" security type. Since we already authenticated using redirection digest auth, we don't need to do this again.
|
||||
obj.send(String.fromCharCode(1)); // Send the "None" security type. Since we already authenticated using redirection digest auth, we don't need to do this again.
|
||||
obj.state = 2;
|
||||
}
|
||||
else if (obj.state == 2 && obj.acc.length >= 4) {
|
||||
// Getting security response
|
||||
cmdsize = 4;
|
||||
if (ReadInt(obj.acc, 0) != 0) { return obj.Stop(); }
|
||||
obj.Send(String.fromCharCode(1)); // Send share desktop flag
|
||||
obj.send(String.fromCharCode(1)); // Send share desktop flag
|
||||
obj.state = 3;
|
||||
}
|
||||
else if (obj.state == 3 && obj.acc.length >= 24) {
|
||||
|
@ -138,11 +138,11 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
|||
if (obj.useZRLE) supportedEncodings += IntToStr(16);
|
||||
supportedEncodings += IntToStr(0);
|
||||
|
||||
obj.Send(String.fromCharCode(2, 0) + ShortToStr((supportedEncodings.length / 4) + 1) + supportedEncodings + IntToStr(-223)); // Supported Encodings + Desktop Size
|
||||
obj.send(String.fromCharCode(2, 0) + ShortToStr((supportedEncodings.length / 4) + 1) + supportedEncodings + IntToStr(-223)); // Supported Encodings + Desktop Size
|
||||
|
||||
// Set the pixel encoding to something much smaller
|
||||
// obj.Send(String.fromCharCode(0, 0, 0, 0, 16, 16, 0, 1) + ShortToStr(31) + ShortToStr(63) + ShortToStr(31) + String.fromCharCode(11, 5, 0, 0, 0, 0)); // Setup 16 bit color RGB565 (This is the default, so we don't need to set it)
|
||||
if (obj.bpp == 1) obj.Send(String.fromCharCode(0, 0, 0, 0, 8, 8, 0, 1) + ShortToStr(7) + ShortToStr(7) + ShortToStr(3) + String.fromCharCode(5, 2, 0, 0, 0, 0)); // Setup 8 bit color RGB332
|
||||
// obj.send(String.fromCharCode(0, 0, 0, 0, 16, 16, 0, 1) + ShortToStr(31) + ShortToStr(63) + ShortToStr(31) + String.fromCharCode(11, 5, 0, 0, 0, 0)); // Setup 16 bit color RGB565 (This is the default, so we don't need to set it)
|
||||
if (obj.bpp == 1) obj.send(String.fromCharCode(0, 0, 0, 0, 8, 8, 0, 1) + ShortToStr(7) + ShortToStr(7) + ShortToStr(3) + String.fromCharCode(5, 2, 0, 0, 0, 0)); // Setup 8 bit color RGB332
|
||||
|
||||
obj.state = 4;
|
||||
obj.parent.xxStateChange(3);
|
||||
|
@ -194,7 +194,7 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
|||
// Desktop Size (0xFFFFFF21, -223)
|
||||
obj.canvas.canvas.width = obj.rwidth = obj.width = width;
|
||||
obj.canvas.canvas.height = obj.rheight = obj.height = height;
|
||||
obj.Send(String.fromCharCode(3, 0, 0, 0, 0, 0) + ShortToStr(obj.width) + ShortToStr(obj.height)); // FramebufferUpdateRequest
|
||||
obj.send(String.fromCharCode(3, 0, 0, 0, 0, 0) + ShortToStr(obj.width) + ShortToStr(obj.height)); // FramebufferUpdateRequest
|
||||
cmdsize = 12;
|
||||
if (obj.onScreenSizeChange != null) { obj.onScreenSizeChange(obj, obj.ScreenWidth, obj.ScreenHeight); }
|
||||
// obj.Debug("New desktop width: " + obj.width + ", height: " + obj.height);
|
||||
|
@ -454,13 +454,13 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
|||
if (obj.focusmode > 0) {
|
||||
// Request only pixels around the last mouse position
|
||||
var df = obj.focusmode * 2;
|
||||
obj.Send(String.fromCharCode(3, 1) + ShortToStr(Math.max(Math.min(obj.ox, obj.mx) - obj.focusmode, 0)) + ShortToStr(Math.max(Math.min(obj.oy, obj.my) - obj.focusmode, 0)) + ShortToStr(df + Math.abs(obj.ox - obj.mx)) + ShortToStr(df + Math.abs(obj.oy - obj.my))); // FramebufferUpdateRequest
|
||||
obj.send(String.fromCharCode(3, 1) + ShortToStr(Math.max(Math.min(obj.ox, obj.mx) - obj.focusmode, 0)) + ShortToStr(Math.max(Math.min(obj.oy, obj.my) - obj.focusmode, 0)) + ShortToStr(df + Math.abs(obj.ox - obj.mx)) + ShortToStr(df + Math.abs(obj.oy - obj.my))); // FramebufferUpdateRequest
|
||||
obj.ox = obj.mx;
|
||||
obj.oy = obj.my;
|
||||
} else {
|
||||
// ###END###{DesktopFocus}
|
||||
// Request the entire screen
|
||||
obj.Send(String.fromCharCode(3, 1, 0, 0, 0, 0) + ShortToStr(obj.rwidth) + ShortToStr(obj.rheight)); // FramebufferUpdateRequest
|
||||
obj.send(String.fromCharCode(3, 1, 0, 0, 0, 0) + ShortToStr(obj.rwidth) + ShortToStr(obj.rheight)); // FramebufferUpdateRequest
|
||||
// ###BEGIN###{DesktopFocus}
|
||||
}
|
||||
// ###END###{DesktopFocus}
|
||||
|
@ -485,10 +485,10 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
|||
obj.parent.Stop();
|
||||
}
|
||||
|
||||
obj.Send = function (x) {
|
||||
obj.send = function (x) {
|
||||
//obj.Debug("KSend(" + x.length + "): " + rstr2hex(x));
|
||||
//obj.outbytes += x.length;
|
||||
obj.parent.Send(x);
|
||||
obj.parent.send(x);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -552,7 +552,7 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
|||
return obj.haltEvent(e);
|
||||
}
|
||||
|
||||
obj.sendkey = function (k, d) { obj.Send(String.fromCharCode(4, d, 0, 0) + IntToStr(k)); }
|
||||
obj.sendkey = function (k, d) { obj.send(String.fromCharCode(4, d, 0, 0) + IntToStr(k)); }
|
||||
|
||||
obj.SendCtrlAltDelMsg = function () { obj.sendcad(); }
|
||||
obj.sendcad = function () {
|
||||
|
@ -625,7 +625,7 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
|||
}
|
||||
// ###END###{DesktopRotation}
|
||||
|
||||
obj.Send(String.fromCharCode(5, obj.buttonmask) + ShortToStr(obj.mx) + ShortToStr(obj.my));
|
||||
obj.send(String.fromCharCode(5, obj.buttonmask) + ShortToStr(obj.mx) + ShortToStr(obj.my));
|
||||
|
||||
// ###BEGIN###{DesktopFocus}
|
||||
// Update focus area if we are in focus mode
|
||||
|
|
|
@ -253,7 +253,7 @@ var CreateAmtRedirect = function (module) {
|
|||
}
|
||||
}
|
||||
|
||||
obj.Send = function (x) {
|
||||
obj.send = function (x) {
|
||||
if (obj.socket == null || obj.connectstate != 1) return;
|
||||
if (obj.protocol == 1) { obj.xxSend(String.fromCharCode(0x28, 0x00, 0x00, 0x00) + IntToStrX(obj.amtsequence++) + ShortToStrX(x.length) + x); } else { obj.xxSend(x); }
|
||||
}
|
||||
|
|
|
@ -554,8 +554,8 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||
}
|
||||
}
|
||||
|
||||
obj.TermSendKeys = function(keys) { obj.parent.Send(keys); }
|
||||
obj.TermSendKey = function(key) { obj.parent.Send(String.fromCharCode(key)); }
|
||||
obj.TermSendKeys = function(keys) { obj.parent.send(keys); }
|
||||
obj.TermSendKey = function(key) { obj.parent.send(String.fromCharCode(key)); }
|
||||
|
||||
function _TermMoveUp(linecount) {
|
||||
var x, y;
|
||||
|
|
|
@ -37,7 +37,7 @@ var MeshServerCreateControl = function (domain) {
|
|||
if (obj.onMessage) obj.onMessage(obj, message);
|
||||
};
|
||||
|
||||
obj.Send = function (x) { if (obj.socket != null && obj.connectstate == 1) { obj.socket.send(JSON.stringify(x)); } }
|
||||
obj.send = function (x) { if (obj.socket != null && obj.connectstate == 1) { obj.socket.send(JSON.stringify(x)); } }
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue