x2go.backends.proxy.base module

X2GoProxy class - proxying/rendering your graphical connection through NX3, KDRIVE and others.

class x2go.backends.proxy.base.X2GoProxy(session_info=None, ssh_transport=None, session_log='session.log', session_errors='session.err', sessions_rootdir='/builddir/.x2go', proxy_options={}, session_instance=None, logger=None, loglevel=56)[source]

Bases: Thread

X2GoProxy is an abstract class for X2Go proxy connections.

This class needs to be inherited from a concrete proxy class. Only currently available proxy class is: x2go.backends.proxy.nx3.X2GoProxy.

PROXY_ARGS = []

Arguments to be passed to the proxy command. This needs to be set by a potential child class.

PROXY_CMD = ''

Proxy command. Needs to be set by a potential child class, might be OS specific.

PROXY_ENV = {}

Provide environment variables to the proxy command. This also needs to be set by a child class.

fw_tunnel = None
ok()[source]

Check if a proxy instance is up and running.

Returns:

Proxy state, True for proxy being up-and-running, False otherwise

Return type:

bool

process_proxy_options()[source]

Override this method to incorporate elements from proxy_options into actual proxy subprocess execution.

This method (if overridden) should (by design) never fail nor raise an exception. Make sure to catch all possible errors appropriately.

If you want to log ignored proxy_options then

  1. remove processed proxy_options from self.proxy_options

  2. once you have finished processing the proxy_options call the parent class method x2go.backends.proxy.base.X2GoProxy.process_proxy_options()

proxy = None
run()[source]

Start the X2Go proxy command. The X2Go proxy command utilizes a Paramiko/SSH based forwarding tunnel (openssh -L option). This tunnel gets started here and is forked into background (Greenlet/gevent).

session_info = None
session_log_stderr = None
session_log_stdout = None
start_proxy()[source]

Start the thread runner and wait for the proxy to come up.

Returns:

a subprocess instance that knows about the externally started proxy command.

Return type:

obj

stop_thread()[source]

End the thread runner and tidy up.