Proxies
A session can reach its host through a proxy: a machine that makes the connection on rheaCRT's behalf. rheaCRT connects to the proxy, asks it for a connection to the host, and from then on the session runs through it as if it were direct. The host's key is checked against the host exactly as for a direct connection, whatever carried it.
In File → New Session…, choose SSH and open SSH proxy. For a saved SSH session, right-click it in the Session Manager and choose Properties…. Pick a proxy type and enter its host. A port of zero uses 1080 for SOCKS and 8080 for HTTP CONNECT. Leave fields inherited to use the folder or all-session settings. Choose Direct to bypass an inherited proxy for this session.
Use Options → SSH Proxy Defaults… for all saved sessions. For a folder, right-click the folder and choose SSH Proxy Defaults…. Settings on an individual session take precedence. Use no proxy user selects anonymous access when the parent supplies a user name.
Set Proxy user if the gateway requires a login. For SOCKS5 or HTTP, rheaCRT asks for the password in the terminal each time you connect. Only the user name goes in the profile. The SSH host key and SSH sign-in that follow belong to the destination. Connection details shows the destination and the proxy socket address separately.
The kinds
| Kind | Who looks up the host's name | Sign-in to the proxy | Usual port |
|---|---|---|---|
| SOCKS5 | The proxy | None, or a user name and password | 1080 |
| SOCKS4a | The proxy | A user id; no password | 1080 |
| SOCKS4 | Nobody: it takes an IPv4 address only | A user id; no password | 1080 |
| HTTP (the CONNECT method) | The proxy | None, or a user name and password (Basic) | None is standard; 3128 and 8080 are common |
The proxy looks up the name, never this computer. A name that only means something inside the network the proxy sits in still works, because it is sent to the proxy as it is. That is usually the point of the proxy. SOCKS4 has no way to carry a name, so with SOCKS4 a name is refused with a sentence that says which kinds take one.
A proxy password is not protected on the way to the proxy. SOCKS5 and HTTP Basic both send it as it is. Use them on a network you trust. rheaCRT never shows the password: not in a message, and not in its own records.
Time limits
Two waits, each with the session's connect timeout (15 seconds unless changed): reaching the proxy, and the proxy opening the connection to the host. The SSH handshake that follows has the same limit again, as for a direct connection.
What a session says when the proxy is the trouble
Every one of these names the proxy, so a fault at the proxy is never taken for a fault at the host.
| What happened | What you see |
|---|---|
| Nothing is listening where the proxy should be | could not connect to the proxy at PROXY: REASON |
| The proxy's machine does not answer | no answer from the proxy at PROXY within 15 seconds |
| The proxy takes the connection and then says nothing | the proxy at PROXY did not open a connection to HOST:PORT within 15 seconds |
| The proxy says no | the proxy at PROXY refused the connection to HOST:PORT: REASON |
| The proxy wants a sign-in and none is set | the proxy at PROXY asked for a user name and password, and none is set for it |
| The proxy rejects the sign-in | the proxy at PROXY did not accept the user name and password set for it |
| It is not that kind of proxy | the proxy at PROXY did not answer as a SOCKS5 proxy |
| It hangs up without a word | the proxy at PROXY closed the connection without a reply: it may not be a SOCKS4 proxy, or it could not open a connection to HOST:PORT |
| It answers at first, then hangs up when asked for the host | the proxy at PROXY closed the connection instead of opening one to HOST:PORT: it could not reach it, or does not allow it |
| SOCKS4 is given a name | the proxy at PROXY is set to SOCKS4, which takes an IPv4 address and not a host name: choose SOCKS4a or SOCKS5 for it, or give the address of HOST |
The reasons a SOCKS5 proxy can give, in rheaCRT's words: it reported a general failure; its rules do not allow it; the network is unreachable; the host is unreachable; the host refused it; the time to live ran out on the way to the host; it does not support the CONNECT command. An HTTP proxy's refusal carries its status, for example its rules do not allow it (HTTP status 403 Forbidden).
Two of the rows above come from a real proxy. The SOCKS proxy built into OpenSSH has no way to say no: when it cannot reach the host, or the far machine does not allow forwarding, it hangs up. Hence the two sentences that say what a hang-up can mean.
Measured
Through OpenSSH's own SOCKS proxy, with the far end of the proxy on a machine across the internet and the host named as that machine names itself (so only the proxy could look the name up):
| Kind | A shell after | Then, through the proxy |
|---|---|---|
| SOCKS5, by name | 0.4 s | 300,000 numbered lines in order; a 512 KiB paste, checksum exact |
| SOCKS4a, by name | 0.4 s | The same |
| SOCKS4, by address | 0.8 s | The same |
A proxy that took the connection and said nothing was given up after exactly the limit set (4.00 s with a limit of 4). Each other failure in the table above was reported in under 20 ms.
Typed commands took about 80 ms through that proxy against 14 ms direct. That is the proxy's own handling of small packets, not the distance: rheaCRT's side adds nothing measurable.
Not there yet
- Another session as the way in (a jump host): the most useful kind for network work, and the largest.
- A local command as the proxy.
- The prompt-and-command kind, for older gateways.
- HTTP sign-in other than Basic, and a proxy that is itself reached over TLS.
- A real HTTP proxy. The HTTP kind is tested against a strict stand-in in the tests, not yet against a proxy product.
Where it lives in the code
crates/core/src/proxy.rs: the four exchanges, written from the SOCKS4 and SOCKS4a memos, RFC 1928 and RFC 1929 (SOCKS5), and RFC 9110 section 9.3.6 with RFC 7617 (HTTP CONNECT and Basic). It never reads past the proxy's reply: the host's first bytes can arrive in the same packet.crates/core/src/ssh2.rs:Target::proxy, and the two waits inconnect_once.- Tests:
crates/core/tests/proxy.rs(49, against stand-in proxies that are strict about every byte) anda_real_socks_proxy_carries_a_session_or_says_why_notincrates/core/tests/remote.rs.