wgproxy

package
v0.22.7 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: BSD-3-Clause Imports: 11 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(wgPort int) *Factory

func (*Factory) Free

func (w *Factory) Free() error

func (*Factory) GetProxy

func (w *Factory) GetProxy() Proxy

type Proxy

type Proxy interface {
	AddTurnConn(urnConn 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(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

func (*WGEBPFProxy) Listen

func (p *WGEBPFProxy) Listen() error

Listen load ebpf program and listen the proxy

type WGUserSpaceProxy

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

WGUserSpaceProxy proxies

func NewWGUserSpaceProxy

func NewWGUserSpaceProxy(wgPort int) *WGUserSpaceProxy

NewWGUserSpaceProxy instantiate a user space WireGuard proxy

func (*WGUserSpaceProxy) AddTurnConn

func (p *WGUserSpaceProxy) AddTurnConn(remoteConn 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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