proxy

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, opts Options) (*Proxy, *Result, *errors.XError)

Start creates and starts a TCP port forwarding proxy.

Types

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, addr string) (net.Conn, error)
	Close() error
}

Dialer defines the interface for establishing connections through SSH. This allows testing with mock implementations.

type Options

type Options struct {
	LocalHost  string
	LocalPort  int
	RemoteHost string
	RemotePort int
	Dialer     Dialer
}

Options holds configuration for starting a proxy.

type Proxy

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

Proxy represents a TCP port forwarding proxy.

func (*Proxy) LocalAddress

func (p *Proxy) LocalAddress() string

LocalAddress returns the actual local address the proxy is listening on.

func (*Proxy) Stop

func (p *Proxy) Stop() error

Stop gracefully shuts down the proxy.

type Result

type Result struct {
	LocalAddress  string
	RemoteAddress string
	SSHProxy      string
}

Result contains information about a started proxy.

Jump to

Keyboard shortcuts

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