Vite plugin to set up a reverse SSH tunnel for reverse proxies
npm install vite-plugin-ssh-tunnelvite.config.js
import { defineConfig } from 'vite';
import { sshTunnel } from 'vite-plugin-ssh-tunnel';
export default defineConfig({
plugins: [
sshTunnel({
username: 'tunnel',
host: 'tunnel.example.com',
privateKey: '/homes/user/.ssh/id_rsa',
})
]
});The username for the SSH connection.
The host for the SSH connection.
The path to the private key for the SSH connection.
The remote port to forward to. Defaults to 3000.
The URL of the reverse proxy server. Defaults to 'https://{host}'.