xhe

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const Subnet = "fdd9:f800::/24"

Variables

View Source
var ErrNoCnamePubkey = errors.New("find 0 cname pubkey")
View Source
var ErrNotWireGuardPubkey = errors.New("not wireguard pubkey")

Functions

func GetIP

func GetIP(pubkey []byte) (pf netip.Prefix, ierr error)

func GetURI

func GetURI(conn *doh.Conn, name string) (endpoint string, ierr error)

func Run

func Run(cfg Config) (dev *device.Device, ierr error)

Types

type Bind

type Bind struct {
	conn.Bind
	// contains filtered or unexported fields
}

func (*Bind) Send

func (b *Bind) Send(bufs [][]byte, ep conn.Endpoint) error

type Config

type Config struct {
	LogLevel   slog.Level `json:"log_level"`
	PrivateKey string     `json:"private_key"`
	DoH        string     `json:"doh"`
	Links      []string   `json:"links"`
	Peers      []string   `json:"peers"`
	Port       uint16     `json:"port"`
	MTU        int        `json:"mtu"`
	GoTun      tun.Device
}

func (Config) Normalize

func (cfg Config) Normalize()

type DoH

type DoH struct {
	Server string
	Client *http.Client
}

func (*DoH) ParsePeer

func (s *DoH) ParsePeer(ctx context.Context, link string) (peer config.Peer, ierr error)

ParsePeer peer://{domain.com}[/preshared_key]?[keepalive=15] peer://{pubkey}[/preshared_key]?[keepalive=15] http[s]://domain/path?peer={pubkey}[&preshared=preshared_key][&keepalive=15]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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