opt.: disable it on iOS

This commit is contained in:
lollipopkit🏳️‍⚧️
2025-10-25 20:37:14 +08:00
parent b6ab8f1db5
commit 92a4601335
4 changed files with 36 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:dartssh2/dartssh2.dart';
import 'package:fl_lib/fl_lib.dart';
@@ -122,24 +123,27 @@ Future<SSHClient> genClient(
// For ProxyCommand and direct connections, get SSHSocket
SSHSocket? socket;
try {
final proxyCommand = spi.proxyCommand;
// ProxyCommand support - Check for ProxyCommand configuration first
if (spi.proxyCommand != null) {
if (proxyCommand != null && !Platform.isIOS) {
try {
Loggers.app.info('Connecting via ProxyCommand: ${spi.proxyCommand!.command}');
Loggers.app.info('Connecting via ProxyCommand: ${proxyCommand.command}');
socket = await ProxyCommandExecutor.executeProxyCommand(
spi.proxyCommand!,
proxyCommand,
hostname: spi.ip,
port: spi.port,
user: spi.user,
);
} catch (e) {
Loggers.app.warning('ProxyCommand failed', e);
if (!spi.proxyCommand!.retryOnFailure) {
if (!proxyCommand.retryOnFailure) {
rethrow;
}
// If retry is enabled, fall through to direct connection
Loggers.app.info('ProxyCommand failed, falling back to direct connection');
}
} else if (proxyCommand != null && Platform.isIOS) {
Loggers.app.info('ProxyCommand configuration is ignored on iOS');
}
// Direct connection (or fallback)