portfwd

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package portfwd provides an SSH port forwarder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAuthFromIdentityFile

func ReadAuthFromIdentityFile(identityFilename string) (ssh.AuthMethod, error)

ReadAuthFromIdentityFile reads an identity file and returns an AuthMethod that uses the given key pairs.

func SSHAgent

func SSHAgent() ssh.AuthMethod

SSHAgent returns an auth method that runs the given function to obtain a list of key pairs.

Types

type Endpoints

type Endpoints struct {
	Local  string
	Server string
	Remote string
}

Endpoints contains addresses of an SSH tunnel components.

type SSHTunnel

type SSHTunnel struct {
	Endpoints Endpoints
	Config    *ssh.ClientConfig
	// contains filtered or unexported fields
}

SSHTunnel describes a tunnel structure.

func NewTunnel

func NewTunnel(localEndpoint, serverEndpoint, remoteEndpoint string, sshConfig *ssh.ClientConfig) *SSHTunnel

NewTunnel create a new tunnel.

func (*SSHTunnel) Listen

func (tunnel *SSHTunnel) Listen(ctx context.Context) error

Listen waits for and processes connections to the SSH tunnel.

func (*SSHTunnel) Open

func (tunnel *SSHTunnel) Open() error

Open starts an ssh tunnel.

func (*SSHTunnel) Stop

func (tunnel *SSHTunnel) Stop() error

Stop stops the SSH tunnel.

Jump to

Keyboard shortcuts

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