wgproxy

package
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory(ctx context.Context, userspace bool, wgPort int) *Factory

func (*Factory) Free

func (w *Factory) Free() error

func (*Factory) GetProxy

func (w *Factory) GetProxy(ctx context.Context) Proxy

type Proxy

type Proxy interface {
	AddTurnConn(turnConn net.Conn) (net.Addr, error)
	CloseConn() error
	Free() error
}

Proxy is a transfer layer between the Turn connection and the WireGuard

type WGEBPFProxy

type WGEBPFProxy struct {
	// contains filtered or unexported fields
}

WGEBPFProxy definition for proxy with EBPF support

func NewWGEBPFProxy

func NewWGEBPFProxy(ctx context.Context, wgPort int) *WGEBPFProxy

NewWGEBPFProxy create new WGEBPFProxy instance

func (*WGEBPFProxy) AddTurnConn

func (p *WGEBPFProxy) AddTurnConn(turnConn net.Conn) (net.Addr, error)

AddTurnConn add new turn connection for the proxy

func (*WGEBPFProxy) CloseConn

func (p *WGEBPFProxy) CloseConn() error

CloseConn doing nothing because this type of proxy implementation does not store the connection

func (*WGEBPFProxy) Free

func (p *WGEBPFProxy) Free() error

Free resources

type WGUserSpaceProxy

type WGUserSpaceProxy struct {
	// contains filtered or unexported fields
}

WGUserSpaceProxy proxies

func NewWGUserSpaceProxy

func NewWGUserSpaceProxy(ctx context.Context, wgPort int) *WGUserSpaceProxy

NewWGUserSpaceProxy instantiate a user space WireGuard proxy

func (*WGUserSpaceProxy) AddTurnConn

func (p *WGUserSpaceProxy) AddTurnConn(turnConn net.Conn) (net.Addr, error)

AddTurnConn start the proxy with the given remote conn

func (*WGUserSpaceProxy) CloseConn

func (p *WGUserSpaceProxy) CloseConn() error

CloseConn close the localConn

func (*WGUserSpaceProxy) Free

func (p *WGUserSpaceProxy) Free() error

Free doing nothing because this implementation of proxy does not have global state

Jump to

Keyboard shortcuts

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