Coder Social home page Coder Social logo

swift-ssh-client's People

Contributors

gaetanzanella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

swift-ssh-client's Issues

Make CI faster

For now, the CI downloads and installs docker at each build. It takes 10 minutes.

We should avoid that:

  • By removing the docker dependency
  • By directly running the code on a container

Clarify ssh connection state concurrency issue

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.

Can't callback

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

Don't get the response data SSHCommand

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

Screenshot 2023-12-07 at 02 36 05

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,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.