Documentation ¶
Index ¶
- func NewVtunUDPForwarder(ctx context.Context, localBind netip.AddrPort, dest string, vtun *VirtualTun, ...) (netip.AddrPort, error)
- func RunScan(ctx context.Context, l *slog.Logger, opts ScanOptions) (result []ipscanner.IPInfo, err error)
- type Configuration
- type InterfaceConfig
- type PeerConfig
- type ScanOptions
- type VirtualTun
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVtunUDPForwarder ¶
Types ¶
type Configuration ¶
type Configuration struct { Interface *InterfaceConfig Peers []PeerConfig }
func ParseConfig ¶
func ParseConfig(path string, endpoint string) (*Configuration, error)
ParseConfig takes the path of a configuration file and parses it into Configuration
type InterfaceConfig ¶
func ParseInterface ¶
func ParseInterface(cfg *ini.File) (InterfaceConfig, error)
ParseInterface parses the [Interface] section
type PeerConfig ¶
type PeerConfig struct { PublicKey string Endpoint string KeepAlive int AllowedIPs []netip.Prefix Trick bool }
func ParsePeers ¶
func ParsePeers(cfg *ini.File) ([]PeerConfig, error)
ParsePeers parses the [Peer] section and extract the information into `peers`
type VirtualTun ¶
type VirtualTun struct { Tnet *netstack.Net Logger *slog.Logger Dev *device.Device Ctx context.Context }
VirtualTun stores a reference to netstack network and DNS configuration
func StartWireguard ¶
func StartWireguard(ctx context.Context, l *slog.Logger, conf *Configuration) (*VirtualTun, error)
StartWireguard creates a tun interface on netstack given a configuration
func (*VirtualTun) StartProxy ¶
StartProxy spawns a socks5 server.
func (*VirtualTun) Stop ¶
func (vt *VirtualTun) Stop()
Click to show internal directories.
Click to hide internal directories.