eve.net.ssh.forwarding
TCP forwarding bridges coupling EVE sockets to SSH channels.
The bridges sit on top of the existing channel contracts: every byte passes through SshChannel reads/writes and every wakeup runs through the session driver, so flow control, window accounting, and EOF/close semantics stay owned by the SSH layer. Per-direction bridge queues are bounded and couple socket read pause/resume to channel writability.
Half-close propagation is independent in both directions: a socket read EOF becomes a channel sendEof after the queued bytes, and a channel peer EOF becomes a socket write shutdown while socket data keeps flowing into the channel.
Bind, destination, and access decisions are explicit caller policy through EveLocalForwardPolicy and EveForwardedBridgePolicy; no bridge accepts traffic on its own.
Types 7
Bounds and defaults for the forwarding bridges.
Scheduling surface the bridges need from the session driver.
EveBridgeHost.of adapts an EveSessionDriver; tests may provide their own host.
void delegate(SshChannel, void delegate()) watchChannelWatches a channel for readable data or send-window relief.void delegate(SshChannel) unwatchChannelStops watching a channel.void delegate() requestPumpRequests a coalesced session pump.void delegate(SshChannelOpenOperation,
void delegate(SshChannelOpenOperation)) watchOpenWatches a channel-open operation for terminal completion.void delegate(SshChannelOpenOperation) unwatchOpenStops watching a channel-open operation.void delegate(Token) cancelDeadlineCancels a registered deadline.Caller-controlled policy for a local forwarding bridge.
string listenAddressAddress the bridge listens on (bind policy).ushort listenPortPort to bind; 0 lets the OS allocate one.string destinationHostDestination host as seen by the SSH server (direct-tcpip).ushort destinationPortDestination port as seen by the SSH server.string originatorAddressOriginator identity reported to the SSH server.ushort originatorPortOriginator port reported to the SSH server.size_t bridgeQueueMaxBounded queue per bridge direction, in bytes.bool delegate() admitAccess policy consulted for every accepted socket; returning false closes the connection without opening a channel. A null delegate refuses everything.Caller-controlled policy for bridging incoming forwarded channels.
size_t bridgeQueueMaxBounded queue per bridge direction, in bytes.Duration connectTimeoutTimeout for the destination connection attempt.bool delegate(scope const SshForwardedChannelInfo info,
out string destinationHost, out ushort destinationPort) admitAccess and destination policy consulted for every incoming forwarded channel. Returning false refuses the channel; otherwise destinationHost/destinationPort receive where to connect. A null delegat...Bridges one EVE TCP connection and one SSH channel.
Data flows in both directions through bounded queues: socket reads pause when the channel-side queue is full and channel reads wait for socket writability. Independent half-closes propagate as described in the module documentation.
void attachChannel(SshChannel channel)Attaches the SSH channel and starts forwarding.void shutdown()Shuts the bridge down: closes the socket and the channel.void onDone(void delegate(EveChannelSocketBridge) onDone) @propertySets the callback invoked once when the bridge becomes terminal.this(EveBridgeHost host, TcpConnection conn, SshChannel channel = null,
size_t queueMax = EveForwardBridgeLimits.bridgeQueueMaxDefault)Constructs a bridge over an established socket.Local forwarding bridge: a caller-bound TCP listener whose accepted sockets each become one direct-tcpip channel.
The bridge never chooses the bind address, destination, or access decision; those come from EveLocalForwardPolicy.
EveChannelSocketBridge[] bridgesLive bridges for accepted connections.void stop()Stops the bridge: closes the listener and every live bridge.this(EveBridgeHost host, ref EventLoop loop,
SshSessionImpl session,
scope const EveLocalForwardPolicy policy)Binds the listener described by the policy.OpeningOne accepted socket waiting for its SSH channel to open.Destination bridge for incoming forwarded TCP/IP channels.
Implements SshForwardedChannelHandler: each admitted channel triggers a destination connection, and the decision stays PENDING until the connection attempt succeeds or fails. Pass handler to SshSession.setForwardedChannelHandler.
void stop()Shuts every pending and live bridge down and refuses further channels.SshForwardAcceptResult decideForwardedChannel(
scope const SshForwardedChannelInfo info, SshChannel channel)this(EveBridgeHost host, ref EventLoop loop,
scope const EveForwardedBridgePolicy policy)Constructs the bridge.Pending