Instance Methodorlandos-nl.citadel 0.8.0Citadel
createDirectTCPIPChannel(using:initialize:)
Creates a new direct TCP/IP channel. This channel type is used to open a TCP/IP connection to a remote host, through the remote SSH server.
DirectTCPIP+Client.swift:39func createDirectTCPIPChannel(using settings: SSHChannelType.DirectTCPIP, initialize: @escaping (Channel) -> EventLoopFuture<Void>) async throws -> Channel
Other members in extension
Types
Type members
static func connect(host: String, port: Int, authenticationMethod: SSHAuthenticationMethod, hostKeyValidator: SSHHostKeyValidator, reconnect: SSHReconnectMode, algorithms: SSHAlgorithms, protocolOptions: Set<SSHProtocolOption>, group: MultiThreadedEventLoopGroup, connectTimeout: TimeAmount
) async throws -> SSHClient Connects to an SSH server.
static func connect(on: Channel, authenticationMethod: @autoclosure @escaping () -> SSHAuthenticationMethod, hostKeyValidator: SSHHostKeyValidator, algorithms: SSHAlgorithms, protocolOptions: Set<SSHProtocolOption>
) async throws -> SSHClient Connects to an SSH server.
Instance members
var eventLoop: EventLoop
The event loop that this SSH connection is running on.
var isConnected: Bool
let logger: Logger
func close(
) async throws func executeCommand(String, maxResponseSize: Int
) async throws -> ByteBuffer Executes a command on the remote server. This will return the output of the command. If the command fails, the error will be thrown. If the output is too large, the command will fail.
func executeCommand(String, maxResponseSize: Int, mergeStreams: Bool, inShell: Bool
) async throws -> ByteBuffer Executes a command on the remote server. This will return the output of the command (stdout). If the command fails, the error will be thrown. If the output is too large, the command will fail.
func executeCommandPair(String, inShell: Bool
) async throws -> ExecCommandStream Executes a command on the remote server. This will return the pair of streams stdout and stderr of the command. If the command fails, the error will be thrown.
func executeCommandStream(String, inShell: Bool
) async throws -> AsyncThrowingStream<ExecCommandOutput, Error> Executes a command on the remote server. This will return the output stream of the command. If the command fails, the error will be thrown.
func onDisconnect(perform: @escaping () -> ()
) func openSFTP(logger: Logger
) async throws -> SFTPClient Open a SFTP subchannel over the SSH connection using the
sftp
subsystem.