Add Tunneling Context to Fab
See original GitHub issueDescription
This would be very helpful for me because it would make it very easy to for example connect to a remote MySQL server using my command line MySQL client.
We could use a “with” context statement, something like:
with tunnel(local=3307, remote=3306):
local('mysql --port=3007 --host=localhost' mydb < db/dbdump.sql')
This would eliminate the need to upload mysql dump file to the server just to be able to run import.
Another application could be for administering Cherokee web servers.
Cherokee web admin by default is only accessible from the server that it’s running on. So you want to access the admin you have to tunnel into the server and access the admin interface using a local port. This could also be simplified with this functionality.
with tunnel(local=9090, remote=9090):
sudo('cherokee-admin')
prompt('Stop cherokee admin?')
That last line would keep the tunnel open until it’s closed by providing input.
Originally submitted by Taras Mankovski (tarasm) on 2009-11-02 at 09:30am EST
Relations
- Related to #38: Implement tunnelling
Issue Analytics
- State:
- Created 12 years ago
- Comments:13 (7 by maintainers)
Top GitHub Comments
#939 is still in a release bucket, I just punted it from the upcoming 1.11 because I needed to cut some stuff, but it’ll get priority for the next feature cycle. (And it looks like #1218 supersedes #939 so I’ll probably end up merging that & crediting #939 in the changelog.)
Is there any plan to resolve this issue? There are two outstanding pull requests that together resolve this, but they haven’t been reviewed? Any way we could speed this along? #939, #1218
I’ve been using the code in #1218 with no problems.