wgproxy

package
v0.65.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL