Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KernelFactory ¶
type KernelFactory struct {
// contains filtered or unexported fields
}
func NewKernelFactory ¶
func NewKernelFactory(wgPort int, mtu uint16) *KernelFactory
func (*KernelFactory) Free ¶
func (w *KernelFactory) Free() error
func (*KernelFactory) GetProxy ¶
func (w *KernelFactory) GetProxy() Proxy
func (*KernelFactory) GetProxyPort ¶ added in v0.64.2
func (w *KernelFactory) GetProxyPort() uint16
GetProxyPort returns the eBPF proxy port, or 0 if eBPF is not active.
type Proxy ¶
type Proxy interface {
AddTurnConn(ctx context.Context, endpoint *net.UDPAddr, remoteConn net.Conn) error
EndpointAddr() *net.UDPAddr // EndpointAddr returns the address of the WireGuard peer endpoint
Work() // Work start or resume the proxy
Pause() // Pause to forward the packages from remote connection to WireGuard. The opposite way still works.
//RedirectAs resume the forwarding the packages from relayed connection to WireGuard interface if it was paused
//and rewrite the src address to the endpoint address.
//With this logic can avoid the package loss from relayed connections.
RedirectAs(endpoint *net.UDPAddr)
CloseConn() error
SetDisconnectListener(disconnected func())
}
Proxy is a transfer layer between the relayed connection and the WireGuard
type USPFactory ¶
type USPFactory struct {
// contains filtered or unexported fields
}
func NewUSPFactory ¶
func NewUSPFactory(bind proxyBind.Bind, mtu uint16) *USPFactory
func (*USPFactory) Free ¶
func (w *USPFactory) Free() error
func (*USPFactory) GetProxy ¶
func (w *USPFactory) GetProxy() Proxy
func (*USPFactory) GetProxyPort ¶ added in v0.64.2
func (w *USPFactory) GetProxyPort() uint16
GetProxyPort returns 0 as userspace WireGuard doesn't use a separate proxy port.
Click to show internal directories.
Click to hide internal directories.