open Direct Tcpip Transport
fun openDirectTcpipTransport(remoteHost: String, remotePort: Int, originAddr: String = LOCALHOST, originPort: Int = 0): TransportFactory?(source)
Create a TransportFactory that tunnels through this SSH connection.
Opens a direct-tcpip channel to remoteHost:remotePort and wraps it as a Transport, allowing a second SshClient to connect through this connection without transiting the kernel network stack (jump host / ProxyJump pattern).
val jump = SshClient("jump.example.com", hostKeyVerifier = jumpVerifier)
jump.connect()
jump.authenticatePassword("user", "pass")
val targetConfig = SshClientConfig {
transportFactory = jump.openDirectTcpipTransport("target.internal", 22)
hostKeyVerifier = myVerifier
}
val target = SshClient(targetConfig)
target.connect()Content copied to clipboard
Return
TransportFactory for use in SshClientConfig, or null if not authenticated
Parameters
remote Host
Host reachable from the SSH server to connect to
remote Port
Port on the remote host
origin Addr
Originator address reported to the server
origin Port
Originator port reported to the server