proxy

package
v0.0.0-...-7edf0cb Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PrivateKeyPath string
	RemoteUser     string
	RemoteAddress  string
}

Config is used to store configuraiton information for the SSH Proxy

type SSHProxy

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

SSHProxy is a ssh client that port forwards based on configuration information.

func New

func New(cfg *Config) (*SSHProxy, error)

New creates an instance of an SSHProxy

func (*SSHProxy) Connect

func (p *SSHProxy) Connect() error

Connect makes the ssh connection to the remote host

func (*SSHProxy) Forward

func (p *SSHProxy) Forward(remote, localPort string) (string, error)

Forward forwards a remote addess to a local port. Set localPort to 0 to generate a random port.

func (*SSHProxy) Shutdown

func (p *SSHProxy) Shutdown()

Shutdown waits for all connections to stop

func (*SSHProxy) WithContext

func (p *SSHProxy) WithContext(ctx context.Context)

WithContext sets the current context value

Jump to

Keyboard shortcuts

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