wiresocks

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeBase64ToHex added in v1.2.2

func EncodeBase64ToHex(key string) (string, error)

func NewVtunUDPForwarder

func NewVtunUDPForwarder(ctx context.Context, localBind netip.AddrPort, dest string, tnet *netstack.Net, mtu int) (netip.AddrPort, error)

func ParseReserved added in v1.2.2

func ParseReserved(str string) ([3]byte, error)

func RunScan

func RunScan(ctx context.Context, l *slog.Logger, opts ScanOptions) (result []ipscanner.IPInfo, err error)

func StartProxy added in v1.2.0

func StartProxy(ctx context.Context, l *slog.Logger, tnet *netstack.Net, bindAddress netip.AddrPort) (netip.AddrPort, error)

StartProxy spawns a socks5 server.

Types

type Configuration

type Configuration struct {
	Interface *InterfaceConfig
	Peers     []PeerConfig
}

func ParseConfig

func ParseConfig(path string) (*Configuration, error)

ParseConfig takes the path of a configuration file and parses it into Configuration

type InterfaceConfig

type InterfaceConfig struct {
	PrivateKey string
	Addresses  []netip.Addr
	DNS        []netip.Addr
	MTU        int
}

func ParseInterface

func ParseInterface(cfg *ini.File) (InterfaceConfig, error)

ParseInterface parses the [Interface] section

type PeerConfig

type PeerConfig struct {
	PublicKey    string
	PreSharedKey string
	Endpoint     string
	KeepAlive    int
	AllowedIPs   []netip.Prefix
	Trick        bool
	Reserved     [3]byte
}

func ParsePeers

func ParsePeers(cfg *ini.File) ([]PeerConfig, error)

ParsePeers parses the [Peer] section and extract the information into `peers`

type ScanOptions

type ScanOptions struct {
	V4         bool
	V6         bool
	MaxRTT     time.Duration
	PrivateKey string
	PublicKey  string
}

type VirtualTun

type VirtualTun struct {
	Tnet   *netstack.Net
	Logger *slog.Logger
	Dev    *device.Device
	Ctx    context.Context
	// contains filtered or unexported fields
}

VirtualTun stores a reference to netstack network and DNS configuration

func (*VirtualTun) Stop

func (vt *VirtualTun) Stop()

Jump to

Keyboard shortcuts

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