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

@@ -1339,7 +1339,8 @@ class FFI {
void start(String id,
{bool isFileTransfer = false,
bool isPortForward = false,
String? switchUuid}) {
String? switchUuid,
bool? forceRelay}) {
assert(!(isFileTransfer && isPortForward), 'more than one connect type');
if (isFileTransfer) {
connType = ConnType.fileTransfer;
@@ -1355,11 +1356,11 @@ class FFI {
}
// ignore: unused_local_variable
final addRes = bind.sessionAddSync(
id: id,
isFileTransfer: isFileTransfer,
isPortForward: isPortForward,
switchUuid: switchUuid ?? "",
);
id: id,
isFileTransfer: isFileTransfer,
isPortForward: isPortForward,
switchUuid: switchUuid ?? "",
forceRelay: forceRelay ?? false);
final stream = bind.sessionStart(id: id);
final cb = ffiModel.startEventListener(id);
() async {