Package x2go :: Module forward :: Class X2GoFwServer

[frames] | no frames]

# Class X2GoFwServer

source code

                      object --+
                               |
    gevent.baseserver.BaseServer --+
                                   |
          gevent.server.StreamServer --+
                                       |
                                      X2GoFwServer

X2GoFwServer implements a gevent's StreamServer based Paramiko/SSH port forwarding server.

An X2GoFwServer class object is used to tunnel graphical trafic through an external proxy command launched by a `X2GoProxy*` backend.

Instance Methods

__init__(self, listener, remote_host, remote_port, ssh_transport, session_instance=None, session_name=None, logger=None, loglevel=56) x.__init__(...) initializes x; see help(type(x)) for signature | source code

x2go_forward_tunnel_handle(self, fw_socket, address) Handle for SSH/Paramiko forwarding tunnel. | source code

close_channel(self) Close an open channel again. | source code

close_socket(self) Close the forwarding tunnel's socket again. | source code

stop(self) Stop the forwarding tunnel. | source code

Inherited from `gevent.server.StreamServer`: `is_fatal_error`, `kill`, `pre_start`, `set_listener`, `set_spawn`, `start_accepting`, `stop_accepting`, `wrap_socket_and_handle`

Inherited from `gevent.baseserver.BaseServer`: `__repr__`, `__str__`, `full`, `post_stop`, `serve_forever`, `set_handle`, `start`

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables
Inherited from `gevent.server.StreamServer`: `max_accept`, `max_delay`, `min_delay` Inherited from `gevent.baseserver.BaseServer`: `backlog`, `reuse_addr`, `stop_timeout`

Properties
Inherited from `gevent.baseserver.BaseServer`: `server_host`, `server_port` Inherited from `object`: `__class__`

Method Details

### __init__(self, listener, remote_host, remote_port, ssh_transport, session_instance=None, session_name=None, logger=None, loglevel=56)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `listener` (`tuple`) - listen on TCP/IP socket `(<IP>, <Port>)`
  - `remote_host` (`str`) - hostname or IP of remote host (in case of X2Go mostly 127.0.0.1)
  - `remote_port` (`int`) - port of remote host
  - `ssh_transport` (`obj`) - a valid Paramiko/SSH transport object
  - `session_instance` (`obj`) - the complete X2GoSession instance of the X2Go session this port forwarding server belongs to. Note: for new X2GoSession instances the object has the session name not yet set(!!!)
  - `session_name` (`str`) - the session name of the X2Go session this port forwarding server belongs to
  - `logger` (`obj`) - you can pass an X2GoLogger object to the X2GoFwServer constructor
  - `loglevel` (`int`) - if no X2GoLogger object has been supplied a new one will be constructed with the given loglevel
Overrides: object.__init__

### x2go_forward_tunnel_handle(self, fw_socket, address)

source code

Handle for SSH/Paramiko forwarding tunnel.

Parameters:
  - `fw_socket` (`obj`) - local end of the forwarding tunnel
  - `address` (`tuple`) - unused/ignored

### stop(self)

source code

Stop the forwarding tunnel.

Overrides: gevent.baseserver.BaseServer.stop