tunnel

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TunnelCmd = &cobra.Command{
	Use:   "tunnel [flags] SERVER [-- COMMAND...]",
	Short: "Create a TCP tunnel (optionally run a command)",
	Long: `
	Create a TCP tunnel that forwards local TCP traffic to a remote server port.
	Use -l/--local and -r/--remote to configure local and remote ports.
	If '-- COMMAND [ARGS...]' is provided, Alpacon runs the local command
	in the same session with the tunnel lifecycle attached.

	Use '--' before the local command so Alpacon parses tunnel flags and forwards
	the rest to the local program exactly as provided.
	`,
	Example: `
	# Forward local 9000 to remote 8082
	alpacon tunnel my-server -l 9000 -r 8082

	# Same using long flags
	alpacon tunnel my-server --local 9000 --remote 8082

	# Forward local 2222 to remote SSH port 22
	alpacon tunnel my-server -l 2222 -r 22

	# Specify username and groupname for the tunnel
	alpacon tunnel my-server -l 9000 -r 8082 -u admin -g developers

	# Run psql with attached tunnel session
	alpacon tunnel prod-db -l 5432 -r 5432 -- psql -h 127.0.0.1 -p 5432 -U app appdb

	# Run kubectl with attached tunnel session
	alpacon tunnel prod-k8s -l 6443 -r 6443 -- kubectl --server=https://127.0.0.1:6443 get pods
	`,
	Args: validateTunnelArgs,
	Run:  runTunnel,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL