fix: 内置 dartssh2 2.11.0 补丁版(third_party 本地依赖),修复新版 Dart SDK 下 sftp_client 编译错误
This commit is contained in:
1 parent
6daa9dd361
commit
0a33fabec2
139 files changed
+16497
-1
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dartssh2/dartssh2.dart';
|
||||
|
||||
void main() async {
|
||||
final jumpServer = SSHClient(
|
||||
await SSHSocket.connect('<jump server>', 22),
|
||||
username: '...',
|
||||
onPasswordRequest: () => '...',
|
||||
);
|
||||
|
||||
final client = SSHClient(
|
||||
await jumpServer.forwardLocal('<target server>', 22),
|
||||
username: '...',
|
||||
onPasswordRequest: () => '...',
|
||||
);
|
||||
|
||||
print(utf8.decode(await client.run('hostname')));
|
||||
print(utf8.decode(await client.run('ifconfig')));
|
||||
|
||||
client.close();
|
||||
jumpServer.close();
|
||||
}
|
||||
Reference in new issue
Block a user