Documentation
¶
Index ¶
- func FindAvailableUDPPort(minPort, maxPort uint16) (uint16, error)
- func NewFixedPortBind(port uint16) conn.Bind
- type Peer
- type PeerBandwidth
- type PeerReading
- type TargetData
- type TargetsByType
- type WgConfig
- type WireGuardService
- func (s *WireGuardService) AddProxyTarget(proto, listenIP string, port int, targetAddr string) error
- func (s *WireGuardService) Close(rm bool)
- func (s *WireGuardService) GetNetstackNet() *netstack.Net
- func (s *WireGuardService) GetProxyManager() *proxy.ProxyManager
- func (s *WireGuardService) GetPublicKey() wgtypes.Key
- func (s *WireGuardService) IsReady() bool
- func (s *WireGuardService) LoadRemoteConfig() error
- func (s *WireGuardService) RemoveProxyTarget(proto, listenIP string, port int) error
- func (s *WireGuardService) ReplaceNetstack() error
- func (s *WireGuardService) ReportRTT(seconds float64)
- func (s *WireGuardService) SetOnNetstackClose(callback func())
- func (s *WireGuardService) SetOnNetstackReady(callback func(*netstack.Net))
- func (s *WireGuardService) SetOthertnet(tnet *netstack.Net)
- func (s *WireGuardService) SetToken(token string)
- func (s *WireGuardService) StartHolepunch(serverPubKey string, endpoint string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAvailableUDPPort ¶
find an available UDP port in the range [minPort, maxPort] and also the next port for the wgtester
func NewFixedPortBind ¶
Types ¶
type PeerBandwidth ¶
type PeerReading ¶
type TargetData ¶
type TargetData struct {
Targets []string `json:"targets"`
}
type TargetsByType ¶
type WgConfig ¶
type WgConfig struct {
IpAddress string `json:"ipAddress"`
Peers []Peer `json:"peers"`
Targets TargetsByType `json:"targets"`
}
type WireGuardService ¶
type WireGuardService struct {
Port uint16
TunnelIP string
// contains filtered or unexported fields
}
func NewWireGuardService ¶
func (*WireGuardService) AddProxyTarget ¶
func (s *WireGuardService) AddProxyTarget(proto, listenIP string, port int, targetAddr string) error
AddProxyTarget adds a target to the proxy manager
func (*WireGuardService) Close ¶
func (s *WireGuardService) Close(rm bool)
func (*WireGuardService) GetNetstackNet ¶
func (s *WireGuardService) GetNetstackNet() *netstack.Net
GetNetstackNet returns the netstack network interface for use by other components
func (*WireGuardService) GetProxyManager ¶
func (s *WireGuardService) GetProxyManager() *proxy.ProxyManager
GetProxyManager returns the proxy manager for this WireGuardService
func (*WireGuardService) GetPublicKey ¶
func (s *WireGuardService) GetPublicKey() wgtypes.Key
GetPublicKey returns the public key of this WireGuard service
func (*WireGuardService) IsReady ¶
func (s *WireGuardService) IsReady() bool
IsReady returns true if the WireGuard service is ready to use
func (*WireGuardService) LoadRemoteConfig ¶
func (s *WireGuardService) LoadRemoteConfig() error
func (*WireGuardService) RemoveProxyTarget ¶
func (s *WireGuardService) RemoveProxyTarget(proto, listenIP string, port int) error
RemoveProxyTarget removes a target from the proxy manager
func (*WireGuardService) ReplaceNetstack ¶
func (s *WireGuardService) ReplaceNetstack() error
Add this method to WireGuardService
func (*WireGuardService) ReportRTT ¶
func (s *WireGuardService) ReportRTT(seconds float64)
ReportRTT allows reporting native RTTs to telemetry, rate-limited externally.
func (*WireGuardService) SetOnNetstackClose ¶
func (s *WireGuardService) SetOnNetstackClose(callback func())
func (*WireGuardService) SetOnNetstackReady ¶
func (s *WireGuardService) SetOnNetstackReady(callback func(*netstack.Net))
SetOnNetstackReady sets a callback function to be called when the netstack interface is ready
func (*WireGuardService) SetOthertnet ¶
func (s *WireGuardService) SetOthertnet(tnet *netstack.Net)
func (*WireGuardService) SetToken ¶
func (s *WireGuardService) SetToken(token string)
func (*WireGuardService) StartHolepunch ¶
func (s *WireGuardService) StartHolepunch(serverPubKey string, endpoint string)