Use Json protocol instead of MessagePack in main agent to fix datetime issues.

This commit is contained in:
Jared Goodwin 2020-03-04 07:13:11 -08:00
parent 42b1411c23
commit 5a708f66ed
32 changed files with 182 additions and 161 deletions

View File

@ -53,7 +53,6 @@ namespace Remotely.Agent.Services
HubConnection = new HubConnectionBuilder()
.WithUrl(ConnectionInfo.Host + "/DeviceHub")
.AddMessagePackProtocol()
.Build();
RegisterMessageHandlers();

View File

@ -72,7 +72,7 @@ namespace Remotely.ScreenCast.Core.Communication
Width = width,
Height = height,
EndOfFrame = false,
ImageBytes = imageBytes.Skip(i).Take(50000).ToArray(),
ImageBytes = imageBytes.Skip(i).Take(50_000).ToArray(),
DtoType = Shared.Enums.DynamicDtoType.FrameInfo
}));
}

View File

@ -153,7 +153,7 @@
</script>
<script>
window.onload = () => {
RemoteControl.Init();
Remotely.Init();
}
</script>
</body>

View File

@ -103,8 +103,6 @@ namespace Remotely.Server.Services
public bool AddOrUpdateDevice(Device device, out Device updatedDevice)
{
device.LastOnline = DateTimeOffset.Now;
var existingDevice = RemotelyContext.Devices.Find(device.ID);
if (existingDevice != null)
{
@ -123,12 +121,12 @@ namespace Remotely.Server.Services
existingDevice.TotalMemory = device.TotalMemory;
existingDevice.TotalStorage = device.TotalStorage;
existingDevice.AgentVersion = device.AgentVersion;
existingDevice.LastOnline = device.LastOnline;
existingDevice.LastOnline = DateTimeOffset.Now;
updatedDevice = existingDevice;
}
else
{
device.LastOnline = DateTimeOffset.Now;
if (HostEnvironment.IsDevelopment() && RemotelyContext.Organizations.Any())
{
var org = RemotelyContext.Organizations.FirstOrDefault();

106
Server/package-lock.json generated
View File

@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"@microsoft/signalr": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-3.1.0.tgz",
"integrity": "sha512-ZAScxodI15jr1MF359jwelhrr/fkvCCTWUB5awRO+ibPyBvMS6KsSzWfN/AObc0EqvJPmYtjJgCBWR62nInlCg==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-3.1.2.tgz",
"integrity": "sha512-NeOJQUvkONpbGdkm/q+riYRomInY3Jm8U1hfCWxwdGn3hoS4m54jyb2ix5V0lgOWBHwpTdgW9i3YI7TFf8AdhA==",
"dev": true,
"requires": {
"eventsource": "^1.0.7",
@ -16,19 +16,19 @@
}
},
"@microsoft/signalr-protocol-msgpack": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@microsoft/signalr-protocol-msgpack/-/signalr-protocol-msgpack-3.1.0.tgz",
"integrity": "sha512-rpxCeoC7m46Z95RfotcB2Ii1uJ3E+C2yGbzviuKiq2S11owewwWHe/mkA+KpyFnaxhGZi9e2dys6PlFwmoOxmQ==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@microsoft/signalr-protocol-msgpack/-/signalr-protocol-msgpack-3.1.2.tgz",
"integrity": "sha512-YYtp/i2foThqfBfkdHKoLH98vJuQzPUWKbE3yGz6id6/rZtW2m4tSZqsjLpdUryym0w48lidTJ75sIJnEC28Qg==",
"dev": true,
"requires": {
"@microsoft/signalr": ">=3.1.0",
"@microsoft/signalr": ">=3.1.2",
"msgpack5": "^4.0.2"
}
},
"@msgpack/msgpack": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-1.11.0.tgz",
"integrity": "sha512-gR/NgUeQGARNabGVAjS59lagyxsCgD0zd4F5oKf9uKt8XNLu4awFBNO/Nstr2q1Iu1UPC5EeJeLZSNdP30m7zQ=="
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-1.12.0.tgz",
"integrity": "sha512-7X4+Mt/TAmxhIR+Hryz0ykxnE9YC3sRH+HhcJ//1l7Z0aJD6YFCkD8UpFzXgpWBlAmybG4cnNVdd2GO6Gh8Pbg=="
},
"@types/bootstrap": {
"version": "4.3.1",
@ -41,9 +41,9 @@
}
},
"@types/jquery": {
"version": "3.3.31",
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.3.31.tgz",
"integrity": "sha512-Lz4BAJihoFw5nRzKvg4nawXPzutkv7wmfQ5121avptaSIXlDNJCUuxZxX/G+9EVidZGuO0UBlk+YjKbwRKJigg==",
"version": "3.3.33",
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.3.33.tgz",
"integrity": "sha512-U6IdXYGkfUI42SR79vB2Spj+h1Ly3J3UZjpd8mi943lh126TK7CB+HZOxGh2nM3IySor7wqVQdemD/xtydsBKA==",
"dev": true,
"requires": {
"@types/sizzle": "*"
@ -56,12 +56,12 @@
"dev": true
},
"ajv": {
"version": "6.10.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz",
"integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
@ -101,9 +101,9 @@
"dev": true
},
"aws4": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz",
"integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz",
"integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==",
"dev": true
},
"bcrypt-pbkdf": {
@ -193,15 +193,15 @@
"dev": true
},
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"dev": true
},
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true
},
"forever-agent": {
@ -318,18 +318,18 @@
}
},
"mime-db": {
"version": "1.42.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz",
"integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==",
"version": "1.43.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
"integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==",
"dev": true
},
"mime-types": {
"version": "2.1.25",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz",
"integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==",
"version": "2.1.26",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz",
"integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==",
"dev": true,
"requires": {
"mime-db": "1.42.0"
"mime-db": "1.43.0"
}
},
"msgpack5": {
@ -378,9 +378,9 @@
"dev": true
},
"psl": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.6.0.tgz",
"integrity": "sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA==",
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz",
"integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==",
"dev": true
},
"punycode": {
@ -425,9 +425,9 @@
}
},
"request": {
"version": "2.88.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
"version": "2.88.2",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
"integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
"dev": true,
"requires": {
"aws-sign2": "~0.7.0",
@ -437,7 +437,7 @@
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.0",
"har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
@ -447,7 +447,7 @@
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.4.3",
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
@ -505,21 +505,13 @@
}
},
"tough-cookie": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
"dev": true,
"requires": {
"psl": "^1.1.24",
"punycode": "^1.4.1"
},
"dependencies": {
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
"integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
"dev": true
}
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
},
"tunnel-agent": {
@ -563,9 +555,9 @@
"dev": true
},
"uuid": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==",
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true
},
"verror": {

View File

@ -3,13 +3,13 @@
"name": "asp.net",
"private": true,
"devDependencies": {
"@microsoft/signalr": "^3.1.0",
"@microsoft/signalr-protocol-msgpack": "^3.1.0",
"@microsoft/signalr": "^3.1.2",
"@microsoft/signalr-protocol-msgpack": "^3.1.2",
"@types/bootstrap": "^4.3.1",
"@types/jquery": "^3.3.31",
"@types/jquery": "^3.3.33",
"msgpack5": "^4.2.1"
},
"dependencies": {
"@msgpack/msgpack": "^1.11.0"
"@msgpack/msgpack": "^1.12.0"
}
}

View File

@ -123,7 +123,10 @@ var __spread = (undefined && undefined.__spread) || function () {
return ar;
};
var utf8_a;
var TEXT_ENCODING_AVAILABLE = true && typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined";
var TEXT_ENCODING_AVAILABLE = typeof process !== "undefined" &&
undefined !== "never" &&
typeof TextEncoder !== "undefined" &&
typeof TextDecoder !== "undefined";
function utf8Count(str) {
var strLength = str.length;
var byteLength = 0;
@ -206,7 +209,7 @@ function utf8EncodeJs(str, output, outputOffset) {
}
}
var sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined;
var TEXT_ENCODER_THRESHOLD = true ? 200 : undefined;
var TEXT_ENCODER_THRESHOLD = typeof process !== "undefined" && undefined !== "force" ? 200 : 0;
function utf8EncodeTEencode(str, output, outputOffset) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
output.set(sharedTextEncoder.encode(str), outputOffset);
@ -266,7 +269,7 @@ function utf8DecodeJs(bytes, inputOffset, byteLength) {
return result;
}
var sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null;
var TEXT_DECODER_THRESHOLD = true ? 200 : undefined;
var TEXT_DECODER_THRESHOLD = typeof process !== "undefined" && undefined !== "force" ? 200 : 0;
function utf8DecodeTD(bytes, inputOffset, byteLength) {
var stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@ -524,18 +527,20 @@ var Encoder_values = (undefined && undefined.__values) || function(o) {
var DEFAULT_MAX_DEPTH = 100;
var DEFAULT_INITIAL_BUFFER_SIZE = 2048;
var Encoder_Encoder = /** @class */ (function () {
function Encoder(extensionCodec, context, maxDepth, initialBufferSize, sortKeys, forceFloat32) {
function Encoder(extensionCodec, context, maxDepth, initialBufferSize, sortKeys, forceFloat32, ignoreUndefined) {
if (extensionCodec === void 0) { extensionCodec = ExtensionCodec_ExtensionCodec.defaultCodec; }
if (maxDepth === void 0) { maxDepth = DEFAULT_MAX_DEPTH; }
if (initialBufferSize === void 0) { initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE; }
if (sortKeys === void 0) { sortKeys = false; }
if (forceFloat32 === void 0) { forceFloat32 = false; }
if (ignoreUndefined === void 0) { ignoreUndefined = false; }
this.extensionCodec = extensionCodec;
this.context = context;
this.maxDepth = maxDepth;
this.initialBufferSize = initialBufferSize;
this.sortKeys = sortKeys;
this.forceFloat32 = forceFloat32;
this.ignoreUndefined = ignoreUndefined;
this.pos = 0;
this.view = new DataView(new ArrayBuffer(this.initialBufferSize));
this.bytes = new Uint8Array(this.view.buffer);
@ -776,12 +781,33 @@ var Encoder_Encoder = /** @class */ (function () {
finally { if (e_1) throw e_1.error; }
}
};
Encoder.prototype.countWithoutUndefined = function (object, keys) {
var e_2, _a;
var count = 0;
try {
for (var keys_1 = Encoder_values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
var key = keys_1_1.value;
if (object[key] !== undefined) {
count++;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
}
finally { if (e_2) throw e_2.error; }
}
return count;
};
Encoder.prototype.encodeMap = function (object, depth) {
var e_3, _a;
var keys = Object.keys(object);
if (this.sortKeys) {
keys.sort();
}
var size = keys.length;
var size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length;
if (size < 16) {
// fixmap
this.writeU8(0x80 + size);
@ -799,10 +825,22 @@ var Encoder_Encoder = /** @class */ (function () {
else {
throw new Error("Too large map object: " + size);
}
for (var i = 0; i < size; i++) {
var key = keys[i];
this.encodeString(key);
this.encode(object[key], depth + 1);
try {
for (var keys_2 = Encoder_values(keys), keys_2_1 = keys_2.next(); !keys_2_1.done; keys_2_1 = keys_2.next()) {
var key = keys_2_1.value;
var value = object[key];
if (!(this.ignoreUndefined && value === undefined)) {
this.encodeString(key);
this.encode(value, depth + 1);
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (keys_2_1 && !keys_2_1.done && (_a = keys_2.return)) _a.call(keys_2);
}
finally { if (e_3) throw e_3.error; }
}
};
Encoder.prototype.encodeExtension = function (ext) {
@ -919,7 +957,7 @@ var defaultEncodeOptions = {};
*/
function encode(value, options) {
if (options === void 0) { options = defaultEncodeOptions; }
var encoder = new Encoder_Encoder(options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32);
var encoder = new Encoder_Encoder(options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined);
encoder.encode(value, 1);
return encoder.getUint8Array();
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -125,7 +125,7 @@ __webpack_require__.r(__webpack_exports__);
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Version token that will be replaced by the prepack command
/** The version of the SignalR Message Pack protocol library. */
var VERSION = "3.1.0";
var VERSION = "3.1.2";

File diff suppressed because one or more lines are too long

View File

@ -1445,7 +1445,7 @@ __webpack_require__.r(__webpack_exports__);
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Version token that will be replaced by the prepack command
/** The version of the SignalR client. */
var VERSION = "3.1.0";
var VERSION = "3.1.2";

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,6 @@ export function Connect() {
var signalR = window["signalR"];
Connection = new signalR.HubConnectionBuilder()
.withUrl("/BrowserHub")
.withHubProtocol(new signalR.protocols.msgpack.MessagePackHubProtocol())
.configureLogging(signalR.LogLevel.Information)
.build();
applyMessageHandlers(Connection);

File diff suppressed because one or more lines are too long

View File

@ -20,7 +20,6 @@ export function Connect() {
var signalR = window["signalR"];
Connection = new signalR.HubConnectionBuilder()
.withUrl("/BrowserHub")
.withHubProtocol(new signalR.protocols.msgpack.MessagePackHubProtocol())
.configureLogging(signalR.LogLevel.Information)
.build();

View File

@ -1,5 +1,5 @@
import { ClipboardTransferTextArea } from "./UI.js";
import { RemoteControl } from "./Main.js";
import { Remotely } from "./Main.js";
var clipboardTimer = -1;
var lastClipboardText = "";
export function WatchClipboard() {
@ -10,7 +10,7 @@ export function WatchClipboard() {
if (lastClipboardText != newText) {
lastClipboardText = newText;
ClipboardTransferTextArea.value = newText;
RemoteControl.RCBrowserSockets.SendClipboardTransfer(newText, false);
Remotely.RCBrowserSockets.SendClipboardTransfer(newText, false);
}
});
}, 100);

View File

@ -1 +1 @@
{"version":3,"file":"ClipboardWatcher.js","sourceRoot":"","sources":["ClipboardWatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,IAAI,cAAc,GAAG,CAAC,CAAC,CAAC;AACxB,IAAI,iBAAiB,GAAG,EAAE,CAAC;AAE3B,MAAM,UAAU,cAAc;IAC1B,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAC9C,iBAAiB,GAAG,WAAW,CAAC;QAEhC,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;YAC9B,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBAC1C,IAAI,iBAAiB,IAAI,OAAO,EAAE;oBAC9B,iBAAiB,GAAG,OAAO,CAAC;oBAC5B,yBAAyB,CAAC,KAAK,GAAG,OAAO,CAAC;oBAC1C,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;iBACxE;YACL,CAAC,CAAC,CAAA;QACN,CAAC,EAAE,GAAG,CAAC,CAAC;IACZ,CAAC,CAAC,CAAC;AACP,CAAC"}
{"version":3,"file":"ClipboardWatcher.js","sourceRoot":"","sources":["ClipboardWatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,IAAI,cAAc,GAAG,CAAC,CAAC,CAAC;AACxB,IAAI,iBAAiB,GAAG,EAAE,CAAC;AAE3B,MAAM,UAAU,cAAc;IAC1B,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QAC9C,iBAAiB,GAAG,WAAW,CAAC;QAEhC,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;YAC9B,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBAC1C,IAAI,iBAAiB,IAAI,OAAO,EAAE;oBAC9B,iBAAiB,GAAG,OAAO,CAAC;oBAC5B,yBAAyB,CAAC,KAAK,GAAG,OAAO,CAAC;oBAC1C,QAAQ,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;iBACnE;YACL,CAAC,CAAC,CAAA;QACN,CAAC,EAAE,GAAG,CAAC,CAAC;IACZ,CAAC,CAAC,CAAC;AACP,CAAC"}

View File

@ -1,5 +1,5 @@
import { ClipboardTransferTextArea } from "./UI.js";
import { RemoteControl } from "./Main.js";
import { Remotely } from "./Main.js";
var clipboardTimer = -1;
var lastClipboardText = "";
@ -13,7 +13,7 @@ export function WatchClipboard() {
if (lastClipboardText != newText) {
lastClipboardText = newText;
ClipboardTransferTextArea.value = newText;
RemoteControl.RCBrowserSockets.SendClipboardTransfer(newText, false);
Remotely.RCBrowserSockets.SendClipboardTransfer(newText, false);
}
})
}, 100);

View File

@ -4,7 +4,7 @@ import { RtcSession } from "./RtcSession.js";
import * as UI from "./UI.js";
import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
var queryString = Utilities.ParseSearchString();
export const RemoteControl = {
export const Remotely = {
RCBrowserSockets: new RCBrowserSockets(),
RtcSession: new RtcSession(),
ClientID: queryString["clientID"] ? decodeURIComponent(queryString["clientID"]) : "",
@ -12,11 +12,11 @@ export const RemoteControl = {
RequesterName: queryString["requesterName"] ? decodeURIComponent(queryString["requesterName"]) : "",
Mode: RemoteControlMode.None,
Init: () => {
UI.ApplyInputHandlers(RemoteControl.RCBrowserSockets);
UI.ApplyInputHandlers(Remotely.RCBrowserSockets);
if (queryString["clientID"]) {
RemoteControl.Mode = RemoteControlMode.Unattended;
Remotely.Mode = RemoteControlMode.Unattended;
UI.ConnectBox.style.display = "none";
RemoteControl.RCBrowserSockets.Connect();
Remotely.RCBrowserSockets.Connect();
}
else if (queryString["sessionID"]) {
UI.SessionIDInput.value = decodeURIComponent(queryString["sessionID"]);
@ -28,12 +28,12 @@ export const RemoteControl = {
},
ConnectToClient: () => {
UI.ConnectButton.disabled = true;
RemoteControl.ClientID = UI.SessionIDInput.value.split(" ").join("");
RemoteControl.RequesterName = UI.RequesterNameInput.value;
RemoteControl.Mode = RemoteControlMode.Normal;
RemoteControl.RCBrowserSockets.Connect();
Remotely.ClientID = UI.SessionIDInput.value.split(" ").join("");
Remotely.RequesterName = UI.RequesterNameInput.value;
Remotely.Mode = RemoteControlMode.Normal;
Remotely.RCBrowserSockets.Connect();
UI.StatusMessage.innerHTML = "Sending connection request...";
}
};
window["RemoteControl"] = RemoteControl;
window["Remotely"] = Remotely;
//# sourceMappingURL=Main.js.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AAE,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC;QACjC,QAAQ,CAAC,QAAQ,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChE,QAAQ,CAAC,aAAa,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC;QACrD,QAAQ,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;QACzC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;QACpC,EAAE,CAAC,aAAa,CAAC,SAAS,GAAG,+BAA+B,CAAC;IACjE,CAAC;CACJ,CAAA;AAED,MAAM,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC"}

View File

@ -7,7 +7,7 @@ import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
var queryString = Utilities.ParseSearchString();
export const RemoteControl = {
export const Remotely = {
RCBrowserSockets: new RCBrowserSockets(),
RtcSession: new RtcSession(),
@ -17,12 +17,12 @@ export const RemoteControl = {
Mode: RemoteControlMode.None,
Init: () => {
UI.ApplyInputHandlers(RemoteControl.RCBrowserSockets);
UI.ApplyInputHandlers(Remotely.RCBrowserSockets);
if (queryString["clientID"]) {
RemoteControl.Mode = RemoteControlMode.Unattended;
Remotely.Mode = RemoteControlMode.Unattended;
UI.ConnectBox.style.display = "none";
RemoteControl.RCBrowserSockets.Connect();
Remotely.RCBrowserSockets.Connect();
}
else if (queryString["sessionID"]) {
UI.SessionIDInput.value = decodeURIComponent(queryString["sessionID"]);
@ -34,12 +34,12 @@ export const RemoteControl = {
},
ConnectToClient: () => {
UI.ConnectButton.disabled = true;
RemoteControl.ClientID = UI.SessionIDInput.value.split(" ").join("");
RemoteControl.RequesterName = UI.RequesterNameInput.value;
RemoteControl.Mode = RemoteControlMode.Normal;
RemoteControl.RCBrowserSockets.Connect();
Remotely.ClientID = UI.SessionIDInput.value.split(" ").join("");
Remotely.RequesterName = UI.RequesterNameInput.value;
Remotely.Mode = RemoteControlMode.Normal;
Remotely.RCBrowserSockets.Connect();
UI.StatusMessage.innerHTML = "Sending connection request...";
}
}
window["RemoteControl"] = RemoteControl;
window["Remotely"] = Remotely;

View File

@ -1,6 +1,6 @@
import * as Utilities from "../Utilities.js";
import * as UI from "./UI.js";
import { RemoteControl } from "./Main.js";
import { Remotely } from "./Main.js";
import { Sound } from "../Sound.js";
import { PopupMessage } from "../UI.js";
import { WatchClipboard } from "./ClipboardWatcher.js";
@ -47,7 +47,7 @@ export class RCBrowserSockets {
this.Connection.invoke("SendRtcAnswerToAgent", sessionDescription.sdp);
}
SendScreenCastRequestToDevice() {
this.Connection.invoke("SendScreenCastRequestToDevice", RemoteControl.ClientID, RemoteControl.RequesterName, RemoteControl.Mode);
this.Connection.invoke("SendScreenCastRequestToDevice", Remotely.ClientID, Remotely.RequesterName, Remotely.Mode);
}
SendLatencyUpdate(sentTime, bytesReceived) {
this.Connection.invoke("SendLatencyUpdate", sentTime, bytesReceived);
@ -182,7 +182,7 @@ export class RCBrowserSockets {
document.title = `${machineName} - Remotely Session`;
});
hubConnection.on("RelaunchedScreenCasterReady", (newClientID) => {
RemoteControl.ClientID = newClientID;
Remotely.ClientID = newClientID;
this.Connection.stop();
this.Connect();
});
@ -206,12 +206,12 @@ export class RCBrowserSockets {
});
hubConnection.on("ReceiveRtcOffer", async (sdp) => {
console.log("Rtc offer SDP received.");
RemoteControl.RtcSession.Init();
await RemoteControl.RtcSession.ReceiveRtcOffer(sdp);
Remotely.RtcSession.Init();
await Remotely.RtcSession.ReceiveRtcOffer(sdp);
});
hubConnection.on("ReceiveIceCandidate", (candidate, sdpMlineIndex, sdpMid) => {
console.log("Ice candidate received.");
RemoteControl.RtcSession.ReceiveCandidate({
Remotely.RtcSession.ReceiveCandidate({
candidate: candidate,
sdpMLineIndex: sdpMlineIndex,
sdpMid: sdpMid

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
import * as Utilities from "../Utilities.js";
import * as UI from "./UI.js";
import { RemoteControl } from "./Main.js";
import { Remotely } from "./Main.js";
import { CursorInfo } from "../Models/CursorInfo.js";
import { Sound } from "../Sound.js";
import { PopupMessage } from "../UI.js";
@ -64,7 +64,7 @@ export class RCBrowserSockets {
SendScreenCastRequestToDevice() {
this.Connection.invoke("SendScreenCastRequestToDevice", RemoteControl.ClientID, RemoteControl.RequesterName, RemoteControl.Mode);
this.Connection.invoke("SendScreenCastRequestToDevice", Remotely.ClientID, Remotely.RequesterName, Remotely.Mode);
}
SendLatencyUpdate(sentTime: Date, bytesReceived: number) {
this.Connection.invoke("SendLatencyUpdate", sentTime, bytesReceived);
@ -200,7 +200,7 @@ export class RCBrowserSockets {
document.title = `${machineName} - Remotely Session`;
});
hubConnection.on("RelaunchedScreenCasterReady", (newClientID: string) => {
RemoteControl.ClientID = newClientID;
Remotely.ClientID = newClientID;
this.Connection.stop();
this.Connect();
});
@ -229,13 +229,13 @@ export class RCBrowserSockets {
hubConnection.on("ReceiveRtcOffer", async (sdp: string) => {
console.log("Rtc offer SDP received.");
RemoteControl.RtcSession.Init();
await RemoteControl.RtcSession.ReceiveRtcOffer(sdp);
Remotely.RtcSession.Init();
await Remotely.RtcSession.ReceiveRtcOffer(sdp);
});
hubConnection.on("ReceiveIceCandidate", (candidate: string, sdpMlineIndex: number, sdpMid: string) => {
console.log("Ice candidate received.");
RemoteControl.RtcSession.ReceiveCandidate({
Remotely.RtcSession.ReceiveCandidate({
candidate: candidate,
sdpMLineIndex: sdpMlineIndex,
sdpMid: sdpMid

View File

@ -1,6 +1,6 @@
import * as UI from "./UI.js";
import * as Utilities from "../Utilities.js";
import { RemoteControl } from "./Main.js";
import { Remotely } from "./Main.js";
import { DynamicDtoType } from "../Models/DynamicDtoType.js";
export class RtcSession {
constructor() {
@ -44,13 +44,11 @@ export class RtcSession {
console.log("Connection state changed to " + this.iceConnectionState);
};
this.PeerConnection.onicecandidate = async (ev) => {
await RemoteControl.RCBrowserSockets.SendIceCandidate(ev.candidate);
await Remotely.RCBrowserSockets.SendIceCandidate(ev.candidate);
};
}
ParseBinaryMessage(data) {
//console.log("WebRTC frame received. Size: " + data.byteLength);
var model = this.MessagePack.decode(data);
//console.log("Received model type " + model.ModelType);
switch (model.DtoType) {
case DynamicDtoType.FrameInfo:
this.ProcessFrameInfo(model);
@ -82,7 +80,7 @@ export class RtcSession {
return this.PeerConnection.remoteDescription.sdp.length > 0;
}).then(async () => {
await this.PeerConnection.setLocalDescription(await this.PeerConnection.createAnswer());
await RemoteControl.RCBrowserSockets.SendRtcAnswer(this.PeerConnection.localDescription);
await Remotely.RCBrowserSockets.SendRtcAnswer(this.PeerConnection.localDescription);
});
}
async ReceiveCandidate(candidate) {

View File

@ -1 +1 @@
{"version":3,"file":"RtcSession.js","sourceRoot":"","sources":["RtcSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,MAAM,OAAO,UAAU;IAAvB;QAGI,gBAAW,GAAQ,MAAM,CAAC,aAAa,CAAC,CAAC;QACzC,kBAAa,GAAiB,EAAE,CAAC;IA4FrC,CAAC;IA3FG,IAAI;QACA,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAiB,CAAC;YACxC,UAAU,EAAE;gBACR,EAAE,IAAI,EAAE,+BAA+B,EAAE;gBACzC,EAAE,IAAI,EAAE,+BAA+B,EAAE;aAC5C;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,CAAC,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE;YACvC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;YACtC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC;YAC9B,IAAI,CAAC,WAA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AAS,CAAC,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QACtC,CAAC,CAAC,CAAA;IACN,CAAC;CACJ"}

View File

@ -1,6 +1,6 @@
import * as UI from "./UI.js";
import * as Utilities from "../Utilities.js";
import { RemoteControl } from "./Main.js";
import { Remotely } from "./Main.js";
import { DynamicDto } from "../Models/DynamicDto.js";
import { DynamicDtoType } from "../Models/DynamicDtoType.js";
@ -50,13 +50,11 @@ export class RtcSession {
console.log("Connection state changed to " + this.iceConnectionState);
}
this.PeerConnection.onicecandidate = async (ev) => {
await RemoteControl.RCBrowserSockets.SendIceCandidate(ev.candidate);
await Remotely.RCBrowserSockets.SendIceCandidate(ev.candidate);
};
}
ParseBinaryMessage(data: ArrayBuffer) {
//console.log("WebRTC frame received. Size: " + data.byteLength);
var model = this.MessagePack.decode(data) as DynamicDto;
//console.log("Received model type " + model.ModelType);
switch (model.DtoType) {
case DynamicDtoType.FrameInfo:
this.ProcessFrameInfo(model as unknown as FrameInfo);
@ -89,7 +87,7 @@ export class RtcSession {
return this.PeerConnection.remoteDescription.sdp.length > 0;
}).then(async () => {
await this.PeerConnection.setLocalDescription(await this.PeerConnection.createAnswer());
await RemoteControl.RCBrowserSockets.SendRtcAnswer(this.PeerConnection.localDescription);
await Remotely.RCBrowserSockets.SendRtcAnswer(this.PeerConnection.localDescription);
})
}
async ReceiveCandidate(candidate: RTCIceCandidate) {

View File

@ -1,5 +1,5 @@
import { SetClipboardText } from "../Utilities.js";
import { RemoteControl } from "./Main.js";
import { Remotely } from "./Main.js";
import { PopupMessage } from "../UI.js";
import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
export var AudioButton = document.getElementById("audioButton");
@ -69,19 +69,19 @@ export function ApplyInputHandlers(sockets) {
PopupMessage("Clipboard sent!");
});
ConnectButton.addEventListener("click", (ev) => {
RemoteControl.ConnectToClient();
Remotely.ConnectToClient();
});
CtrlAltDelButton.addEventListener("click", (ev) => {
if (!RemoteControl.ServiceID) {
if (!Remotely.ServiceID) {
ShowMessage("Not available for this session.");
return;
}
closeAllHorizontalBars(null);
RemoteControl.RCBrowserSockets.SendCtrlAltDel();
Remotely.RCBrowserSockets.SendCtrlAltDel();
});
DisconnectButton.addEventListener("click", (ev) => {
ConnectButton.removeAttribute("disabled");
RemoteControl.RCBrowserSockets.Connection.stop();
Remotely.RCBrowserSockets.Connection.stop();
if (location.search.includes("fromApi=true")) {
window.close();
}
@ -89,7 +89,7 @@ export function ApplyInputHandlers(sockets) {
document.querySelectorAll("#sessionIDInput, #nameInput").forEach(x => {
x.addEventListener("keypress", (ev) => {
if (ev.key.toLowerCase() == "enter") {
RemoteControl.ConnectToClient();
Remotely.ConnectToClient();
}
});
});
@ -115,19 +115,19 @@ export function ApplyInputHandlers(sockets) {
var button = ev.currentTarget;
button.classList.toggle("toggled");
if (button.classList.contains("toggled")) {
RemoteControl.RCBrowserSockets.SendToggleBlockInput(true);
Remotely.RCBrowserSockets.SendToggleBlockInput(true);
}
else {
RemoteControl.RCBrowserSockets.SendToggleBlockInput(false);
Remotely.RCBrowserSockets.SendToggleBlockInput(false);
}
});
InviteButton.addEventListener("click", (ev) => {
var url = "";
if (RemoteControl.Mode == RemoteControlMode.Normal) {
url = `${location.origin}${location.pathname}?sessionID=${RemoteControl.ClientID}`;
if (Remotely.Mode == RemoteControlMode.Normal) {
url = `${location.origin}${location.pathname}?sessionID=${Remotely.ClientID}`;
}
else {
url = `${location.origin}${location.pathname}?clientID=${RemoteControl.ClientID}&serviceID=${RemoteControl.ServiceID}`;
url = `${location.origin}${location.pathname}?clientID=${Remotely.ClientID}&serviceID=${Remotely.ServiceID}`;
}
SetClipboardText(url);
PopupMessage("Link copied to clipboard.");
@ -408,7 +408,7 @@ function uploadFiles(fileList) {
FileTransferProgress.parentElement.setAttribute("hidden", "hidden");
if (xhr.status === 200) {
ShowMessage("File upload completed.");
RemoteControl.RCBrowserSockets.SendSharedFileIDs(xhr.responseText);
Remotely.RCBrowserSockets.SendSharedFileIDs(xhr.responseText);
}
else {
ShowMessage("File upload failed.");

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
import { RCBrowserSockets } from "./RCBrowserSockets.js";
import { GetDistanceBetween, SetClipboardText } from "../Utilities.js";
import { RemoteControl } from "./Main.js";
import { Remotely } from "./Main.js";
import { PopupMessage } from "../UI.js";
import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
import { Point } from "../Models/Point.js";
@ -74,19 +74,19 @@ export function ApplyInputHandlers(sockets: RCBrowserSockets) {
PopupMessage("Clipboard sent!");
});
ConnectButton.addEventListener("click", (ev) => {
RemoteControl.ConnectToClient();
Remotely.ConnectToClient();
});
CtrlAltDelButton.addEventListener("click", (ev) => {
if (!RemoteControl.ServiceID) {
if (!Remotely.ServiceID) {
ShowMessage("Not available for this session.");
return;
}
closeAllHorizontalBars(null);
RemoteControl.RCBrowserSockets.SendCtrlAltDel();
Remotely.RCBrowserSockets.SendCtrlAltDel();
});
DisconnectButton.addEventListener("click", (ev) => {
ConnectButton.removeAttribute("disabled");
RemoteControl.RCBrowserSockets.Connection.stop();
Remotely.RCBrowserSockets.Connection.stop();
if (location.search.includes("fromApi=true")) {
window.close();
}
@ -94,7 +94,7 @@ export function ApplyInputHandlers(sockets: RCBrowserSockets) {
document.querySelectorAll("#sessionIDInput, #nameInput").forEach(x => {
x.addEventListener("keypress", (ev: KeyboardEvent) => {
if (ev.key.toLowerCase() == "enter") {
RemoteControl.ConnectToClient();
Remotely.ConnectToClient();
}
})
});
@ -120,19 +120,19 @@ export function ApplyInputHandlers(sockets: RCBrowserSockets) {
var button = ev.currentTarget as HTMLButtonElement;
button.classList.toggle("toggled");
if (button.classList.contains("toggled")) {
RemoteControl.RCBrowserSockets.SendToggleBlockInput(true);
Remotely.RCBrowserSockets.SendToggleBlockInput(true);
}
else {
RemoteControl.RCBrowserSockets.SendToggleBlockInput(false);
Remotely.RCBrowserSockets.SendToggleBlockInput(false);
}
});
InviteButton.addEventListener("click", (ev) => {
var url = "";
if (RemoteControl.Mode == RemoteControlMode.Normal) {
url = `${location.origin}${location.pathname}?sessionID=${RemoteControl.ClientID}`;
if (Remotely.Mode == RemoteControlMode.Normal) {
url = `${location.origin}${location.pathname}?sessionID=${Remotely.ClientID}`;
}
else {
url = `${location.origin}${location.pathname}?clientID=${RemoteControl.ClientID}&serviceID=${RemoteControl.ServiceID}`;
url = `${location.origin}${location.pathname}?clientID=${Remotely.ClientID}&serviceID=${Remotely.ServiceID}`;
}
SetClipboardText(url);
PopupMessage("Link copied to clipboard.");
@ -443,7 +443,7 @@ function uploadFiles(fileList: FileList) {
FileTransferProgress.parentElement.setAttribute("hidden", "hidden");
if (xhr.status === 200) {
ShowMessage("File upload completed.");
RemoteControl.RCBrowserSockets.SendSharedFileIDs(xhr.responseText);
Remotely.RCBrowserSockets.SendSharedFileIDs(xhr.responseText);
}
else {
ShowMessage("File upload failed.");