Expand description
SSH tunnelling with a mandatory deadline (bounded one-shot).
Four modes share this entry point, split across submodules because they share a lifecycle but not a data path:
| Mode | Who listens | Submodule |
|---|---|---|
| local forward | this process | local |
| SOCKS5 proxy | this process | local + socks |
| remote Unix socket | this process | local + streamlocal |
| reverse forward | the SSH server | reverse |
What lives here is everything the modes genuinely share: the deadline
wrapper, the counters it reads after cancellation, the exposure guards, and
the two helpers (pump, drain_forwards) that every mode ends up calling.
Structs§
- Serve
Context - Everything an already-connected client needs to serve one tunnel, minus the mode-specific destination.
- Tunnel
Auth - SSH credential overrides for one tunnel invocation.
- Tunnel
Request - Everything one
tunnelinvocation needs. - Tunnel
Stats - Counters shared between the accept loop and the deadline wrapper.
Enums§
- Forward
Kind - What an accepted local connection is forwarded to.
- Tunnel
Mode - Which tunnel the caller asked for.
Functions§
- guard_
network_ exposure - Rejects a non-loopback bind unless the caller explicitly accepted the risk.
- guard_
remote_ exposure - Rejects a reverse forward that would publish a remote listener.
- resolve_
tunnel_ connection - Builds the connection config for a tunnel from an already-loaded registry record.
- run_
tunnel - Runs the
tunnelsubcommand with a mandatory timeout. - run_
tunnel_ with_ client - Testable local-forward loop (see
run_tunnel_with_client_statsfor counters). - run_
tunnel_ with_ client_ stats - Testable local-forward loop that publishes lifetime counters into
ServeContext::stats. - validate_
remote_ socket - Rejects a remote socket path that cannot be valid on any POSIX host.