This heroku buildpack makes it possible for an application to establish ssh tunnel to reach a remote host. This buildpack must be used with a language-specific buildpack as a supplement.
- Add this buildpack before your language-specific buildpacks:
$ heroku buildpacks:set https://github.com/emartech/heroku-buildpack-ssh-tunnel
- Add your language-specific buildpack (nodejs in this case):
$ heroku buildpacks:set heroku/nodejs
Configuration | Value |
---|---|
openssh connect timeout | 10 sec |
keepalive interval | 10 sec |
maximum number of keepalives | 3 |
reconnect after | 5 sec |
The buildpack creates an ssh tunnel on the basis of the environment variables configured for Heroku:
SSHTUNNEL_PRIVATE_KEY
: Private key for connecting to the tunnel hostSSHTUNNEL_TUNNEL_CONFIG
: Tunnel configuration (openssh -L syntax without theLOCAL_HOST
)[LOCAL PORT]:[REMOTE_HOST]:[REMOTE_PORT]
SSHTUNNEL_REMOTE_USER
: Username for connecting to the tunnel serverSSHTUNNEL_REMOTE_HOST
: The tunnel server hostnameSSHTUNNEL_REMOTE_PORT
: (optional) Port for connecting the tunnel server. Default is 22.
The buildpack logs to the standard output with the 'ssh-tunnel' prefix.
Event | Description |
---|---|
starting | logged on dyno start |
spawned | logged after "tunnel-daemon" starts |
missing-configuration | logged on any missing configuration (tunnel-daemon is not started as variables are not defined properly) |
ssh-connection-init | logged before initiating ssh connection |
ssh-connection-end | logged after the ssh connection ends or there is a connection error |