Documentation
¶
Index ¶
- type ProxyManager
- func (pm *ProxyManager) AddTarget(proto, listenIP string, port int, targetAddr string) error
- func (pm *ProxyManager) ClearTunnelID()
- func (pm *ProxyManager) GetTargets() (tcpTargets map[string]map[int]string, udpTargets map[string]map[int]string)
- func (pm *ProxyManager) PrintTargets()
- func (pm *ProxyManager) RemoveTarget(proto, listenIP string, port int) error
- func (pm *ProxyManager) SetAsyncBytes(b bool)
- func (pm *ProxyManager) SetBlocked(v bool)
- func (pm *ProxyManager) SetTNet(tnet *netstack.Net)
- func (pm *ProxyManager) SetTunnelID(id string)
- func (pm *ProxyManager) SetUDPIdleTimeout(d time.Duration)
- func (pm *ProxyManager) Start() error
- func (pm *ProxyManager) Stop() error
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProxyManager ¶
type ProxyManager struct {
// contains filtered or unexported fields
}
ProxyManager handles the creation and management of proxy connections
func NewProxyManager ¶
func NewProxyManager(tnet *netstack.Net) *ProxyManager
NewProxyManager creates a new proxy manager instance backed by a netstack.
func NewProxyManagerNative ¶ added in v1.14.0
func NewProxyManagerNative(listenIP string) *ProxyManager
NewProxyManagerNative creates a proxy manager that binds listeners directly to the host network stack on the given IP address.
func NewProxyManagerWithoutTNet ¶
func NewProxyManagerWithoutTNet() *ProxyManager
NewProxyManagerWithoutTNet creates a proxy manager with no backing network. Call SetTNet before starting.
func (*ProxyManager) AddTarget ¶
func (pm *ProxyManager) AddTarget(proto, listenIP string, port int, targetAddr string) error
AddTarget adds as new target for proxying
func (*ProxyManager) ClearTunnelID ¶
func (pm *ProxyManager) ClearTunnelID()
ClearTunnelID clears cached attribute sets for the current tunnel.
func (*ProxyManager) GetTargets ¶ added in v1.11.0
func (pm *ProxyManager) GetTargets() (tcpTargets map[string]map[int]string, udpTargets map[string]map[int]string)
GetTargets returns a copy of the current TCP and UDP targets Returns map[listenIP]map[port]targetAddress for both TCP and UDP
func (*ProxyManager) PrintTargets ¶
func (pm *ProxyManager) PrintTargets()
write a function to print out the current targets in the ProxyManager
func (*ProxyManager) RemoveTarget ¶
func (pm *ProxyManager) RemoveTarget(proto, listenIP string, port int) error
func (*ProxyManager) SetAsyncBytes ¶
func (pm *ProxyManager) SetAsyncBytes(b bool)
func (*ProxyManager) SetBlocked ¶ added in v1.13.0
func (pm *ProxyManager) SetBlocked(v bool)
SetBlocked enables or disables connection blocking. When enabled, all new incoming TCP connections are immediately closed and all incoming UDP packets are silently dropped.
func (*ProxyManager) SetTNet ¶
func (pm *ProxyManager) SetTNet(tnet *netstack.Net)
Function to add tnet to existing ProxyManager
func (*ProxyManager) SetTunnelID ¶
func (pm *ProxyManager) SetTunnelID(id string)
SetTunnelID sets the WireGuard peer public key used as tunnel_id label.
func (*ProxyManager) SetUDPIdleTimeout ¶ added in v1.12.0
func (pm *ProxyManager) SetUDPIdleTimeout(d time.Duration)
SetUDPIdleTimeout configures when idle UDP client flows are reclaimed.
func (*ProxyManager) Start ¶
func (pm *ProxyManager) Start() error
Start begins listening for all configured proxy targets
func (*ProxyManager) Stop ¶
func (pm *ProxyManager) Stop() error