force relay when id is suffixed with "/r"

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-02-13 16:40:24 +08:00
parent 759c1901a5
commit 6f106251f9
15 changed files with 127 additions and 63 deletions

View File

@@ -41,11 +41,15 @@ class RustDeskMultiWindowManager {
int? _fileTransferWindowId;
int? _portForwardWindowId;
Future<dynamic> newRemoteDesktop(String remoteId,
{String? switch_uuid}) async {
Future<dynamic> newRemoteDesktop(
String remoteId, {
String? switch_uuid,
bool? forceRelay,
}) async {
var params = {
"type": WindowType.RemoteDesktop.index,
"id": remoteId,
"forceRelay": forceRelay
};
if (switch_uuid != null) {
params['switch_uuid'] = switch_uuid;
@@ -78,9 +82,12 @@ class RustDeskMultiWindowManager {
}
}
Future<dynamic> newFileTransfer(String remoteId) async {
final msg =
jsonEncode({"type": WindowType.FileTransfer.index, "id": remoteId});
Future<dynamic> newFileTransfer(String remoteId, {bool? forceRelay}) async {
var msg = jsonEncode({
"type": WindowType.FileTransfer.index,
"id": remoteId,
"forceRelay": forceRelay,
});
try {
final ids = await DesktopMultiWindow.getAllSubWindowIds();
@@ -107,9 +114,14 @@ class RustDeskMultiWindowManager {
}
}
Future<dynamic> newPortForward(String remoteId, bool isRDP) async {
final msg = jsonEncode(
{"type": WindowType.PortForward.index, "id": remoteId, "isRDP": isRDP});
Future<dynamic> newPortForward(String remoteId, bool isRDP,
{bool? forceRelay}) async {
final msg = jsonEncode({
"type": WindowType.PortForward.index,
"id": remoteId,
"isRDP": isRDP,
"forceRelay": forceRelay,
});
try {
final ids = await DesktopMultiWindow.getAllSubWindowIds();