Package paramiko :: Module proxy :: Class ProxyCommand
[frames] | no frames]

Class ProxyCommand

source code

object --+
         |
        ProxyCommand

Wraps a subprocess running ProxyCommand-driven programs.

This class implements a the socket-like interface needed by the `.Transport` and `.Packetizer` classes. Using this class instead of a regular socket makes it possible to talk with a Popen'd command that will proxy traffic between the client and a server hosted in another machine.

Instance Methods
 
__init__(self, command_line)
Create a new CommandProxy instance.
source code
 
send(self, content)
Write the content received from the SSH client to the standard input of the forked command.
source code
 
recv(self, size)
Read from the standard output of the forked program.
source code
 
close(self) source code
 
settimeout(self, timeout) source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, command_line)
(Constructor)

source code 

Create a new CommandProxy instance. The instance created by this
class can be passed as an argument to the `.Transport` class.

:param str command_line:
    the command that should be executed and used as the proxy.

Overrides: object.__init__

send(self, content)

source code 

Write the content received from the SSH client to the standard input of the forked command.

:param str content: string to be sent to the forked command

recv(self, size)

source code 

Read from the standard output of the forked program.

:param int size: how many chars should be read

:return: the length of the read content, as an `int`