Expand description
Client side of this library.
§Implementing clients
Maybe surprisingly, the data types used by Russh to implement clients are relatively more complicated than for servers. This is mostly related to the fact that clients are generally used both in a synchronous way (in the case of SSH, we can think of sending a shell command), and asynchronously (because the server may send unsollicited messages), and hence need to handle multiple interfaces.
The Session is passed to the Handler when the client receives data.
Check out the following examples:
Structs§
- Config
- The configuration of clients.
- GexParams
- Parameters for dynamic group Diffie-Hellman key exchanges.
- Handle
- Handle to a session, used to send messages to a client outside of the request/response cycle.
- Prompt
- Remote
Disconnect Info - Session
- Actual client session’s state.
Enums§
Traits§
- Handler
- A client handler. Note that messages can be received from the server at any time during a session.
Functions§
- connect
- Connect to a server at the address specified, using the
Handler(implemented by you) andConfigspecified. Returns a future that resolves to aHandle. This handle can then be used to create channels, which in turn can be used to tunnel TCP connections, request a PTY, execute commands, etc. The future will resolve to an error if the connection fails. This function creates a connection to theaddrspecified using atokio::net::TcpStreamand then callsconnect_streamunder the hood. - connect_
stream - Connect a stream to a server. This stream must implement
tokio::io::AsyncReadandtokio::io::AsyncWrite, as well asUnpinandSend. Typically, you may prefer to useconnect, which uses atokio::net::TcpStreamand then calls this function under the hood.
Type Aliases§
- Channel
Open Handle - Internal state for a server-initiated channel-open request awaiting accept or reject.
A handle passed to
server_channel_open_*callbacks that the handler uses to accept or reject the server’s channel request.