proxy

package
v1.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ProxyPortStart is the first port that will be allocated by the proxy component.
	// Others will be incremented by 1 each time
	ProxyPortStart = "9400"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	ProxyForwards map[string][]*ProxyForward
	// contains filtered or unexported fields
}

Proxy represents the proxy component instance

func NewProxy

func NewProxy(view ui.ViewInterface, hostfile hostfile.HostfileInterface) *Proxy

NewProxy initializes a new proxy component instance

func (*Proxy) AddProxyForward

func (p *Proxy) AddProxyForward(name string, proxyForward *ProxyForward)

AddProxyForward creates a new ProxyForward instance and attributes an IP address and a proxy port to it

func (*Proxy) Listen

func (p *Proxy) Listen() error

Listen opens a TCP proxy for each ProxyForward instance

func (*Proxy) Stop added in v0.0.5

func (p *Proxy) Stop() error

Stop stops all currently active proxy listeners

type ProxyForward

type ProxyForward struct {
	Name          string
	Hostname      string
	ProxyHostname string
	LocalPort     string
	ForwardPort   string
	LocalIP       string
	ProxyPort     string
}

func NewProxyForward

func NewProxyForward(name, hostname, proxyHostname, localPort, forwardPort string) *ProxyForward

NewProxyForward returns a new proxy port-forward instance

func (*ProxyForward) GetHostname added in v0.0.4

func (p *ProxyForward) GetHostname() string

GetHostname returns the hostname (if defined) of this proxy forward, elsewhere uses the service name

func (*ProxyForward) GetProxifiedPorts

func (p *ProxyForward) GetProxifiedPorts() string

GetProxifiedPorts returns the couple of proxified ports (proxy attributed port:forward port)

func (*ProxyForward) GetProxyHostname added in v0.0.9

func (p *ProxyForward) GetProxyHostname() string

GetProxyHostname returns the proxy sender hostname depending on forward type In case of a forward type 'proxy', it will return the specified proxy hostname, elsewhere it will return 127.0.0.1 because other forwards forward traffic locally

func (*ProxyForward) SetLocalIP added in v0.0.4

func (p *ProxyForward) SetLocalIP(ip string)

SetLocalIP sets local attributed IP to this forward

func (*ProxyForward) SetProxyPort

func (p *ProxyForward) SetProxyPort(port string)

SetProxyPort sets proxy attributed port to this forward

type ProxyInterface added in v0.0.8

type ProxyInterface interface {
	Listen() error
	Stop() error
	AddProxyForward(name string, proxyForward *ProxyForward)
}

Jump to

Keyboard shortcuts

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