readd: jump server

This commit is contained in:
lollipopkit
2024-04-21 00:42:00 +08:00
parent 9d1df94f89
commit 23764f8c93
5 changed files with 110 additions and 113 deletions

View File

@@ -60,28 +60,25 @@ Future<SSHClient> genClient(
onStatus?.call(GenSSHClientStatus.socket);
final socket = await () async {
/// Issues #210
/// Temporarily comment out the proxy function
// Proxy
// final jumpSpi_ = () {
// // Multi-thread or key login
// if (jumpSpi != null) return jumpSpi;
// // Main thread
// if (spi.jumpId != null) return Stores.server.box.get(spi.jumpId);
// }();
// if (jumpSpi_ != null) {
// final jumpClient = await genClient(
// jumpSpi_,
// privateKey: jumpPrivateKey,
// timeout: timeout,
// );
final jumpSpi_ = () {
// Multi-thread or key login
if (jumpSpi != null) return jumpSpi;
// Main thread
if (spi.jumpId != null) return Stores.server.box.get(spi.jumpId);
}();
if (jumpSpi_ != null) {
final jumpClient = await genClient(
jumpSpi_,
privateKey: jumpPrivateKey,
timeout: timeout,
);
// return await jumpClient.forwardLocal(
// spi.ip,
// spi.port,
// );
// }
return await jumpClient.forwardLocal(
spi.ip,
spi.port,
);
}
// Direct
try {