proxy

package
v0.21.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWgKeepAlive = 25 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	WgListenAddr string
	RemoteKey    string
	WgInterface  *iface.WGIface
	AllowedIps   string
	PreSharedKey *wgtypes.Key
}

type DummyProxy

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

DummyProxy just sends pings to the RemoteKey peer and reads responses

func NewDummyProxy

func NewDummyProxy(remote string) *DummyProxy

func (*DummyProxy) Close

func (p *DummyProxy) Close() error

func (*DummyProxy) Start

func (p *DummyProxy) Start(remoteConn net.Conn) error

func (*DummyProxy) Type

func (p *DummyProxy) Type() Type

type NoProxy

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

NoProxy is used just to configure WireGuard without any local proxy in between. Used when the WireGuard interface is userspace and uses bind.ICEBind

func NewNoProxy

func NewNoProxy(config Config) *NoProxy

NewNoProxy creates a new NoProxy with a provided config

func (*NoProxy) Close

func (p *NoProxy) Close() error

Close removes peer from the WireGuard interface

func (*NoProxy) Start

func (p *NoProxy) Start(remoteConn net.Conn) error

Start just updates WireGuard peer with the remote address

func (*NoProxy) Type

func (p *NoProxy) Type() Type

type Proxy

type Proxy interface {
	io.Closer
	// Start creates a local remoteConn and starts proxying data from/to remoteConn
	Start(remoteConn net.Conn) error
	Type() Type
}

type Type

type Type string
const (
	TypeDirectNoProxy Type = "DirectNoProxy"
	TypeWireGuard     Type = "WireGuard"
	TypeDummy         Type = "Dummy"
	TypeNoProxy       Type = "NoProxy"
)

type WireGuardProxy added in v0.16.0

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

WireGuardProxy proxies

func NewWireGuardProxy added in v0.16.0

func NewWireGuardProxy(config Config) *WireGuardProxy

func (*WireGuardProxy) Close added in v0.16.0

func (p *WireGuardProxy) Close() error

func (*WireGuardProxy) Start added in v0.16.0

func (p *WireGuardProxy) Start(remoteConn net.Conn) error

func (*WireGuardProxy) Type added in v0.16.0

func (p *WireGuardProxy) Type() Type

Jump to

Keyboard shortcuts

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