gaetanzanella / swift-ssh-client Goto Github PK
View Code? Open in Web Editor NEWHigh-level SSH client interfaces using SwiftNIO SSH
License: MIT License
High-level SSH client interfaces using SwiftNIO SSH
License: MIT License
For now, the CI downloads and installs docker at each build. It takes 10 minutes.
We should avoid that:
let connection = SSHConnection(...)
connection.stateUpdateHandler = { state in
if state != connection.state {
// ????
}
}
This case can happen as the update callback is called asynchronously. Is it correct? We should check how NWConnection manages this case.
swift-ssh
is maybe too wide. Could be :
swift-ssh-client
swift-ssh-connection
Hi there,
I put this code in button.
DispatchQueue.global(qos: .background).async {
let connection = SSHConnection(
host: "192.168.31.16",
port: 22,
authentication: SSHAuthentication(
username: "pi",
method: .password(.init("aa11aa1")),
hostKeyValidation: .acceptAll()
)
)
connection.start(withTimeout: 3.0) { result in
switch result {
case .success:
DispatchQueue.main.async {
output = "SSH connected."
}
// Handle connection
case .failure:
DispatchQueue.main.async {
output = "SSH connect failed. \(result)"
}
// Handle failure
}
}
but .success and .failure branch not callback.
I change port to 23 (this port is wrong), .failure branch callback, look like connect success not callback.
Thanks.
buhe
I'm trying to create a project (this is my first BIG swift project)I will be able to connect to my raspberryPi (my server in this project) (ssh connection looks good)
and do these functions:
fetch(currentDirectory: String) - get a list of all files and folders names and a date of the last time they were modified in currentDirectory in the server.
delete(currentDirectory: String, fileName:String) - delete a file/folder by its name that is in currentDirectory in the server.
upload(LocalPath: String, serverPath:String) - upload file from client to server
download(LocalPath: String, serverPath:String) - download file from server to client
For start im trying to build my fetch function using SSHCommand that you created in SSHClient package, but I don't get the data in the response, not even when I'm trying to run this code with the command "echo Hello \n" as Ive seen in the readme of the project
If Im wrong and didn't understood how to use it, please correct me.
If you have any idea how to use this package to create the functions I mentioned before, I'll be glad for help too
Thanks in advance,
The state management of the shell is unclear and the code is not tested
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.