A simple package for establishing an SSH tunnel for local development
Set the environment variables:
WORMHOLE_REMOTE_HOST
- the remote host you are connecting toWORMHOLE_REMOTE_PORT
- the remote port assigned to you by the host
Import the module establish a connection exposing port 3000
:
const wormhole = require('wormhole')
wormhole.connect(3000, (err, url) => {
if (err) {
throw err
}
console.log(`Your URL is: ${url}`)
})
This module can also be used via the CLI, like so:
WORMHOLE_REMOTE_HOST='...' \
WORMHOLE_REMOTE_PORT=... \
wormhole 3000