Skip to main content

Module relay

Module relay 

Source
Expand description

Bidirectional stdin/stdout relay over an SSH exec channel (FR-14 through FR-17).

The relay spawns a background task that copies tokio::io::stdin() into the channel’s write half, and runs a read loop on the current task that copies channel data to tokio::io::stdout() and tokio::io::stderr().

When the remote process exits, its exit code is returned. Exit-via-signal is translated to 128 + signal_number, matching OpenSSH convention (FR-17).

Functions§

relay_channel
Runs a full bidirectional relay between the local process stdio and the given open SSH channel until the remote command exits.