ssh

package
v0.0.0-...-54f0b18 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WireGuardManagerCtor func(debug bool) manager.Manager = func(debug bool) manager.Manager { return wireguard.NewManager(debug) }
	TailscaleManagerCtor func(debug bool) manager.Manager = func(debug bool) manager.Manager { return tailscale.NewManager(debug) }
	DirectManagerCtor    func(debug bool) manager.Manager = func(debug bool) manager.Manager { return direct.NewManager(debug) }
)

Dependency injection for tunnel manager constructors (for testing)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles SSH connections and tunnel management.

func NewClient

func NewClient(cfg *config.WireSshConfig, debug bool, debugTunnel bool) *Client

NewClient creates a new SSH client with the given configuration and debug flags.

func (*Client) Connect

func (c *Client) Connect(outputWriter io.Writer) error

Connect establishes an SSH connection over the configured tunnel, sets up port forwarding and session recording if enabled. It handles authentication using identity files and SSH agents, verifies host keys, and manages terminal I/O. The function returns an error if the connection or session setup fails.

func (*Client) StartTunnelNetwork

func (c *Client) StartTunnelNetwork() (manager manager.Manager, err error)

StartTunnelNetwork starts the appropriate tunnel (WireGuard, Tailscale, or Direct) based on the configuration. Returns a manager.Manager for the tunnel, or an error if setup fails.

type PortForward

type PortForward struct {
	BindAddress string
	Port        string
	Host        string
	HostPort    string
}

PortForward represents a port forwarding configuration

Jump to

Keyboard shortcuts

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