Documentation ¶
Index ¶
Constants ¶
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
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) }