host.transport¶
Hop transport abstractions for multi-hop connectivity.
A HopTransport decouples the transport mechanism (SSH tunnel, future
telnet relay, etc.) from ConnectionManager. The concrete
SshHopTransport wraps an SSHClientConnection and provides tunnel
access and local port forwarding — the same operations that Phase 1
performed inline inside ConnectionManager.
For multi-hop chains each transport may hold a reference to a parent transport. Closing a transport cascades to its parent, tearing down the entire chain from the outermost hop inward.
- class otto.host.transport.HopTransport(*args, **kwargs)¶
Bases:
ProtocolMinimal interface that
ConnectionManagerneeds from a hop.
-
class otto.host.transport.SshHopTransport(factory, parent=
None)¶ Bases:
objectConcrete
HopTransportbacked by an SSH connection.Parameters¶
- factory:
Async callable that returns an
SSHClientConnectionto the hop host. Called at most once (lazily, on firstget_tunnel).- parent:
Optional parent transport whose tunnel this transport’s connection rides over. Closed automatically when this transport is closed.
-
async get_tunnel(_visited=
None)¶ Return the hop SSH connection, creating it via the factory if needed.
_visitedthreads the cycle-detection set used byRemoteHost._build_hop_transport()’s factory through the parent chain. External callers don’t need to pass it.- Return type:¶
SSHClientConnection