Documentation
¶
Index ¶
- type Peer
- type PeerBandwidth
- type PeerReading
- type PortRange
- type Target
- type WgConfig
- type WireGuardService
- func (s *WireGuardService) Close()
- func (s *WireGuardService) GetNetstackNet() *netstack2.Net
- func (s *WireGuardService) GetPublicKey() wgtypes.Key
- func (s *WireGuardService) IsReady() bool
- func (s *WireGuardService) LoadRemoteConfig() error
- func (s *WireGuardService) ReportRTT(seconds float64)
- func (s *WireGuardService) SetOnNetstackClose(callback func())
- func (s *WireGuardService) SetOnNetstackReady(callback func(*netstack2.Net))
- func (s *WireGuardService) SetOthertnet(tnet *netstack.Net)
- func (s *WireGuardService) SetToken(token string)
- func (s *WireGuardService) StartDirectUDPRelay(tunnelIP string) error
- func (s *WireGuardService) StartHolepunch(publicKey string, endpoint string, relayPort uint16)
- func (s *WireGuardService) StopDirectUDPRelay()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerBandwidth ¶
type PeerReading ¶
type WireGuardService ¶
type WireGuardService struct {
Port uint16
// Proxy manager for tunnel
TunnelIP string
// contains filtered or unexported fields
}
func NewWireGuardService ¶
func (*WireGuardService) Close ¶
func (s *WireGuardService) Close()
func (*WireGuardService) GetNetstackNet ¶
func (s *WireGuardService) GetNetstackNet() *netstack2.Net
GetNetstackNet returns the netstack network interface for use by other components
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) 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(*netstack2.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) StartDirectUDPRelay ¶
func (s *WireGuardService) StartDirectUDPRelay(tunnelIP string) error
StartDirectUDPRelay starts a direct UDP relay from the main tunnel netstack to the clients' WireGuard. This bypasses the proxy by listening on the main tunnel's netstack and forwarding packets directly to the SharedBind that feeds the clients' WireGuard device. Responses are automatically routed back through the netstack by the SharedBind. tunnelIP is the IP address to listen on within the main tunnel's netstack.
func (*WireGuardService) StartHolepunch ¶
func (s *WireGuardService) StartHolepunch(publicKey string, endpoint string, relayPort uint16)
StartHolepunch starts hole punching to a specific endpoint
func (*WireGuardService) StopDirectUDPRelay ¶
func (s *WireGuardService) StopDirectUDPRelay()
StopDirectUDPRelay stops the direct UDP relay and closes the netstack listener