Package x2go :: Module rforward

[frames] | no frames]

# Module rforward

source code

X2Go reverse SSH/Paramiko tunneling provides X2Go sound, X2Go printing and X2Go sshfs for folder sharing and mounting remote devices in X2Go terminal server sessions.

Classes
| X2GoRevFwTunnel X2GoRevFwTunnel class objects are used to reversely tunnel X2Go audio, X2Go printing and X2Go folder sharing / device mounting through Paramiko/SSH.
| X2GoRevFwChannelThread Starts a thread for each incoming Paramiko/SSH data channel trough the reverse forwarding tunnel.

Functions

x2go_transport_tcp_handler(chan, (origin_addr, origin_port), (server_addr, server_port)) An X2Go customized TCP handler for the Paramiko/SSH `Transport()` class. | source code

x2go_rev_forward_channel_handler(chan=None, addr=`'````'`, port=0, parent_thread=None, logger=None) Handle the data stream of a requested channel that got set up by a X2GoRevFwTunnel (Paramiko/SSH reverse forwarding tunnel). | source code

Variables
| __NAME__ = ``'``x2gorevtunnel-pylib``'``
| __package__ = ``'``x2go``'``

Function Details

### x2go_transport_tcp_handler(chan, (origin_addr, origin_port), (server_addr, server_port))

source code

An X2Go customized TCP handler for the Paramiko/SSH `Transport()` class.

Incoming channels will be put into Paramiko's default accept queue. This corresponds to the default behaviour of Paramiko's `Transport` class.

However, additionally this handler function checks the server port of the incoming channel and detects if there are Paramiko/SSH reverse forwarding tunnels waiting for the incoming channels. The Paramiko/SSH reverse forwarding tunnels are initiated by an X2GoSession instance (currently supported: reverse tunneling auf audio data, reverse tunneling of SSH requests).

If the server port of an incoming Paramiko/SSH channel matches the configured port of an X2GoRevFwTunnel instance, this instance gets notified of the incoming channel and a new X2GoRevFwChannelThread is started. This X2GoRevFwChannelThread then takes care of the new channel's incoming data stream.

### x2go_rev_forward_channel_handler(chan=None, addr=`'````'`, port=0, parent_thread=None, logger=None)

source code

Handle the data stream of a requested channel that got set up by a X2GoRevFwTunnel (Paramiko/SSH reverse forwarding tunnel).

The channel (and the corresponding connections) close either ...

- ... if the connecting application closes the connection and thus, drops the channel, or
- ... if the X2GoRevFwTunnel parent thread gets paused. The call of X2GoRevFwTunnel.pause() on the instance can be used to shut down all incoming tunneled SSH connections associated to this X2GoRevFwTunnel instance from within a Python X2Go application.

Parameters:
  - `chan` (`class`) - channel
  - `addr` (`str`) - bind address
  - `port` (`int`) - bind port
  - `parent_thread` (X2GoRevFwTunnel instance) - the calling X2GoRevFwTunnel instance
  - `logger` (X2GoLogger instance) - you can pass an X2GoLogger object to the X2GoRevFwTunnel constructor