paramiko/paramiko — pull request #97 by clarete (2012-10-18 21:59:00+00:00)
Title: Adding support for the ProxyCommand feature

Now, instead of just ignoring the ProxyCommand var, the ssh library is able to retrieve
this configuration from the `~/.ssh/conf` file and use it to proxy the connection between
the client and the SSH server.

This commit introduces the paramiko.proxy module that implements the interface required by
the `client.Transport` class. But instead of using sockets, this class writes and reads info
from a peopened program that actually talks with the ssh server.

Given the following ssh config entry:

host comum
User lincoln
hostname comum.org
IdentityFile ~/.ssh/id_rsa
ProxyCommand ssh -q -o StrictHostKeyChecking=no localhost nc %h 22

Here's a simple test case

```python

import ssh
import sys

def test_client(host_name):
conf = ssh.SSHConfig()
conf.parse(open(os.path.expanduser('~/.ssh/config')))
host = conf.lookup(host_name)
client = ssh.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(
host['hostname'], username=host['user'],
key_filename=host['identityfile'],
proxy_command=host.get('proxycommand')
)
stdin, stdout, stderr = client.exec_command('ls /home')
print stdout.read()
stdin, stdout, stderr = client.exec_command('ls /')
print stdout.read()

if __name__ == '__main__':
test_client(sys.argv[1])
```

Run it with the following comand:
```shell
python example.py comum
```

Side note: This is just the same pull request filed agains the `ssh`[0] library and I'm reopening it here as per @bitprophet's request.

[0] https://github.com/bitprophet/ssh/pull/34