wireguard

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CaddyfileKeyPublic              = "public"
	CaddyfileKeyPrivate             = "private"
	CaddyfileKeyPreShared           = "preShared"
	CaddyfileKeyPersistentKeepAlive = "persistentKeepAlive"
	CaddyfileKeyEndpoint            = "endpoint"
	CaddyfileKeyAddress             = "address"
	CaddyfileKeyKeyfile             = "keyfile"
)
View Source
const ModuleName = "caddy.listeners.wireguard"

Variables

View Source
var DefaultKeepAlive uint32 = 25

Functions

This section is empty.

Types

type Listener

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

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

func (*Listener) AppendCloser

func (l *Listener) AppendCloser(fn func() error)

func (*Listener) Close

func (l *Listener) Close() error

func (*Listener) SetError

func (l *Listener) SetError(err error) bool

type Module

type Module struct {
	Public              string  `json:"public,omitempty"`              // server public key
	Private             string  `json:"private,omitempty"`             // client private key
	PreShared           string  `json:"preShared,omitempty"`           // pre-shared key
	KeyFile             *string `json:"keyFile,omitempty"`             // keyfile to fill the above fields
	PersistentKeepAlive *uint32 `json:"persistentKeepAlive,omitempty"` // default 25 if nil
	Endpoint            string  `json:"endpoint,omitempty"`            // wireguard server endpoint
	Address             string  `json:"address,omitempty"`             // Client IP in tunnel
}

func (*Module) CaddyModule

func (mod *Module) CaddyModule() caddy.ModuleInfo

func (*Module) Provision

func (mod *Module) Provision(caddy.Context) error

func (*Module) UnmarshalCaddyfile

func (mod *Module) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

func (*Module) Validate

func (mod *Module) Validate() error

func (*Module) Wireguard

func (mod *Module) Wireguard() (w *Wireguard, err error)

func (*Module) WrapListener

func (mod *Module) WrapListener(listener net.Listener) net.Listener

type Wireguard

type Wireguard struct {
	Public              wg.Key             `json:"public"`
	Private             wg.Key             `json:"private"`
	PreShared           wg.Key             `json:"preShared"`
	PersistentKeepAlive uint32             `json:"persistentKeepAlive"`
	Endpoint            wg.ApiPeerEndpoint `json:"endpoint"`
	Address             wg.IPv4            `json:"address"`
}

func (*Wireguard) Validate

func (mod *Wireguard) Validate() error

func (*Wireguard) WrapListener

func (mod *Wireguard) WrapListener(listener net.Listener) (wrapped net.Listener)

Jump to

Keyboard shortcuts

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