on_ssh_channel_open_request Event
Fired when a host attempts to open a new channel.
Syntax
class SSHClientSSHChannelOpenRequestEventParams(object): @property def channel_id() -> str: ... @property def service() -> str: ... @property def parameters() -> bytes: ... @property def accept() -> bool: ... @accept.setter def accept(value) -> None: ... # In class SSHClient: @property def on_ssh_channel_open_request() -> Callable[[SSHClientSSHChannelOpenRequestEventParams], None]: ... @on_ssh_channel_open_request.setter def on_ssh_channel_open_request(event_hook: Callable[[SSHClientSSHChannelOpenRequestEventParams], None]) -> None: ...
Remarks
This event is fired whenever a host attempts to open a new channel. 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.
If the channel open request contains extra information, it will be contained in Parameters; you can extract data from it using get_ssh_param and get_ssh_param_bytes. 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).