Closed pedromzadeh closed 1 year ago
@pedromzadeh I’d go a step further and add ssh config to enable forwarding of multiple ports and agent forwarding as well. I raised this in #928 before I saw your issue
This is doable but it's going to involve some work. We need to add the relevant features in our Objective-C libssh2 wrapper https://github.com/thebaselab/NMSSH to support this.
This is doable but it's going to involve some work. We need to add the relevant features in our Objective-C libssh2 wrapper https://github.com/thebaselab/NMSSH to support this.
I’ll go dig up my Objective-C skills…
I’ll go dig up my Objective-C skills…
@thekeith I am working on it.
Proposed NMSSH API:
class NMSSHChannel {
// ...
/*
Start listening on a local port and forward any TCP connection to the host, non-blocking
queue: The queue where libssh2 calls are executed in (libssh2 and NMSSH are not thread-safe by design)
*/
func bindLocalPortToRemoteHost(localListenIP: String, localPort: Int32, hostTargetIP: Int32, hostTargetPort: Int32, in queue: DispatchQueue) throws -> NMSSHSocket
}
class NMSSHSocket {
// Underlying libssh2 socket
private var sock: libssh2_socket_t
// To stop listening on a port
func close()
// TODO: Delegate / methods for status updates
}
bindLocalPortToRemoteHost()
:
accept()
is a blocking call, it should be called in a new thread / DispatchGroup
. libssh2_channel_direct_tcpip_ex
Great to see progress here. How would it be configured?
One caveat is making sure that it doesn’t require a separate action to connect forwarded ports. In Termius for example you have to make a completely separate connection and initiate it for port forwarding which makes it a pain to set up, especially when you’re already in a session or want to forward multiple ports.
Ideally it would be great to allow users to do so via a UX which simply writes to a ~/.ssh/config file.
Great to see progress here. How would it be configured?
One caveat is making sure that it doesn’t require a separate action to connect forwarded ports. In Termius for example you have to make a completely separate connection and initiate it for port forwarding which makes it a pain to set up, especially when you’re already in a session or want to forward multiple ports.
Ideally it would be great to allow users to do so via a UX which simply writes to a ~/.ssh/config file.
It would be configured through both GUI and config file. Let's support GUI first and deal with parsing .ssh/config in https://github.com/thebaselab/codeapp/issues/928.
It will be available for testing in TestFlight after 1.5.0 is approved for public testing:
Would it be possible to implement SSH port forwarding? The Blink app has this feature, so I think it should be achievable on iOS.
For instance,
ssh -L 8888:localhost:8888 username@server_address
.Would be pretty useful for spinning up and accessing remote Jupyter servers.