localPortForward

suspend fun localPortForward(bindAddress: InetSocketAddress, remoteHost: String, remotePort: Int): PortForwarder?(source)

Start local port forwarding (RFC 4254 section 7.2).

Listens on bindAddress locally and forwards each connection through SSH to remoteHost:remotePort on the remote side.

Return

PortForwarder handle, or null if not authenticated

Parameters

bindAddress

Local address to bind

remoteHost

Remote host to connect to through SSH

remotePort

Remote port to connect to through SSH


suspend fun localPortForward(bindPort: Int, remoteHost: String, remotePort: Int): PortForwarder?(source)

Start local port forwarding bound to localhost.

Return

PortForwarder handle, or null if not authenticated

Parameters

bindPort

Local port to bind (0 for automatic)

remoteHost

Remote host to connect to through SSH

remotePort

Remote port to connect to through SSH