TurboTunnel creates on-demand ssh tunnels. It listens on local ports, starts up ssh connections when something connects to those ports, and proxies data through the remote tunnel.
Trust me, it's magic.
$ go get github.com/zwily/turbotunnel
$ go build github.com/zwily/turbotunnel
tunnels:
- name: Work Intranet
localPort: 10001
jumpHost: jump1.example.com
remoteHost: 10.0.13.10
remotePort: 80
- name: Work Active Directory RDP
localPort: 10002
jumpHost: [email protected]
remoteHost: 10.0.0.4
remotePort: 3389
$ ./turbotunnel -config /path/to/config.yml
Once TurboTunnel is running, you can then open https://localhost:10001
in your browser. TurboTunnel will see the connection to port 10001 and
initiate an ssh connection to jump1.example.com forwarding a local port
to 10.0.13.10:80. TurboTunnel will then proxy all data between the
opened connection and the local tunnel.
If you're using OS X, you can get desktop notifications when a tunnel
is started by installing terminal-notifier
:
$ brew install terminal-notifier
I run TurboTunnel via launchd. Sample configuration, placed in
~/Library/LaunchAgents/com.github.zwily.turbotunnel.plist
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.zwily.turbotunnel</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/turbotunnel</string>
<string>-config</string>
<string>/Users/zach/.turbotunnel.yml</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
To start it after putting the file in place:
$ launchctl load ~/Library/LaunchAgents/com.github.zwily.turbotunnel.plist