Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.SSH.ForwardingClient

Feature notes: SSH implementation notes

Classes, interfaces and records

classTstCustomSSHForwardingClient

(no public members)

classtSSHClientChannelForwarded

(no public members)

interfaceiSSHClientChannelForwarded

inherits from iSSHClientChannel

function GetForwardingClient: TstCustomSSHForwardingClient; function GetConnAddress: string; function GetConnPortNum: UInt32; function GetRemAddress: string; function GetRemPortNum: UInt32; property ForwardingClient: TstCustomSSHForwardingClient read GetForwardingClient; property ConnAddress: string read GetConnAddress; property ConnPortNum: UInt32 read GetConnPortNum; property RemAddress: string read GetRemAddress; property RemPortNum: UInt32 read GetRemPortNum;

classtSSHClientChannelForwardedThread

inherits from tPooledThread

(no public members)

classTstCustomSSHForwardingClient

inherits from TstCustomSSHThreadPoolComponent

implements iSSHListenerClient

constructor Create(aComponent: TComponent); override;
Standard component constructor. An application never calls this directly; the component is instantiated by the streaming system or created with a normal Create at runtime. Sets AddressToBind to "0.0.0.0" as the default. » member page
destructor Destroy; override;
Refuses every forwarded connection from then on, ends each one in progress and waits until the thread serving it has finished with it, and leaves the SSH client's channel broker. Full description »
class function OpenRequestType: string; virtual;
The SSH global-request name sent to the server (via InternalOpen) to establish this forward. Returns "tcpip-forward" (RFC 4254 7.1), the request for remote/-R forwarding. Virtual so a subclass could return a different request name; applications rarely call it. » member page
class function CloseRequestType: string; virtual;
The SSH global-request name sent (via InternalClose) to tear the forward down again; returns "cancel-tcpip-forward" (RFC 4254 7.1). Paired with OpenRequestType and likewise virtual; applications rarely call it directly. » member page
procedure Open;
Call after SSHClient is connected to ask the server to start listening on AddressToBind:PortNumberToBind and forward incoming connections back over the SSH tunnel to this client (remote/-R forwarding). Raises if no SSHClient is assigned. If PortNumberToBind is 0 the server picks a free port and this call updates PortNumberToBind with the value chosen. » member page
procedure Close;
Cancels the remote listener previously established with Open, so the server stops accepting new forwarded connections on the bound address/port. » member page
property Connected: Boolean read GetConnected write SetConnected;
Toggles the remote forward on or off: setting True calls Open, setting False calls Close. Reads back True once the forward is active. Convenient when you want to drive the forward from a checkbox or a persisted setting rather than calling Open/Close explicitly. » member page
property SSHClient: TstCustomSSHClient read fSSHClient write SetSSHClient;
The connected SSH client transport that carries this forward. Assign the TstSSHClient your application already uses for its session; the forwarding request travels over that same tunnel. Must be assigned and connected before Open. Clearing it (or freeing the client) drops the forward. » member page
property AddressToBind: string read fAddressToBind write SetAddressToBind;
The address the SERVER is asked to bind its listener on (this is remote forwarding, so the bind happens on the SSH server, not locally). Full description »
property PortNumberToBind: UInt32 read fPortNumberToBind write SetPortNumberToBind;
The port the server is asked to listen on for the remote forward. Set it before Open. Pass 0 to let the server choose a free port; Open then writes the server-assigned port back into this property so you can read it. » member page
property BeforeCreateChannelThread: tCreateChannelThreadEvent read fBeforeCreateChannelThread write SetBeforeCreateChannelThread;
Fired just before a worker thread is spun up for each newly forwarded connection, giving the application the chance to supply its own thread instance in the var parameter (e.g. from a custom pool) instead of the default pooled thread. Leave unassigned to use the built-in thread pool. » member page

classTstSSHForwardingClient — component reference

inherits from TstCustomSSHForwardingClient

property OnChannelExecute;
Fired on a worker thread for each connection the server forwards back to this client, once the SSH channel is fully open. Full description »

classtSSHClientChannelForwarded

inherits from tSSHClientChannel

implements iSSHClientChannelForwarded

destructor Destroy; override;

Types (enumerations, sets, aliases)

proctChannelExecuteEvent

  tChannelExecuteEvent = procedure (Sender  : TObject;
                              const aChannel: iSSHClientChannelForwarded) of object;

proctCreateChannelThreadEvent

  tCreateChannelThreadEvent = procedure (Sender  : TObject;
                                   const aChannel: iSSHClientChannelForwarded;
                                     var aThread : tSSHClientChannelForwardedThread) of object;