SSHChannelOpenRequest Event
Fired when a client attempts to open a new channel.
Syntax
type TSSHChannelOpenRequestEvent = procedure SSHChannelOpenRequest(Sender: TObject; ConnectionId: Integer; ChannelId: Integer; const Service: String; Parameters: String;var Accept: Boolean) of object;property OnSSHChannelOpenRequest: TSSHChannelOpenRequestEvent read FOnSSHChannelOpenRequest write FOnSSHChannelOpenRequest;
Remarks
This event is fired whenever a client attempts to open a new channel for a given connection. ChannelId will contain the id of the channel to be created. Service will identify the type of channel that is being requested (e.g.: "session"). Set Accept to true to accept the channel open request.
ConnectionId identifies the connection. ChannelId identifies the channel.
If the channel open request contains extra information, it will be contained in Parameters; you can extract data from it using GetSSHParam and GetSSHParamBytes. The most common example of a request with parameters would be a request with Service set to "direct-tcpip" (for SSH tunneling); in that case Parameters will contain the host to connect (string), the port to connect (int), the originator IP address (string) and the originator TCP port (int).
Note: Processing long-running requests, including sending channel data, inside this event may cause the underlying transport to stop processing SSH data until the event returns. In order to prevent this from happening, all requests should be processed asynchronously in a separate thread outside of this event.