Versions in this module Expand all Collapse all v1 v1.2.5 Apr 4, 2026 v1.2.4 Apr 4, 2026 v1.2.3 Apr 4, 2026 v1.2.2 Apr 4, 2026 v1.2.1 Apr 4, 2026 Changes in this version + func ParseInterface(cfg *ini.File, device *DeviceConfig) error + func ParsePeers(cfg *ini.File, peers *[]PeerConfig) error + func STDIOTcpForward(vt *VirtualTun, raddr *addressPort, input *os.File, output *os.File) + func ValidateASecConfig(config *ASecConfigType) error + type ASecConfigType struct + func ParseASecConfig(section *ini.Section) (*ASecConfigType, error) + type Configuration struct + Device *DeviceConfig + Resolve *ResolveConfig + Routines []RoutineSpawner + func ParseConfig(path string) (*Configuration, error) + type CredentialValidator struct + func (c CredentialValidator) Valid(username, password string) bool + type DeviceConfig struct + ASecConfig *ASecConfigType + CheckAlive []netip.Addr + CheckAliveInterval int + DNS []netip.Addr + Endpoint []netip.Addr + ListenPort *int + MTU int + Peers []PeerConfig + SecretKey string + type DeviceSetting struct + DNS []netip.Addr + DeviceAddr []netip.Addr + IpcRequest string + MTU int + func CreateIPCRequest(conf *DeviceConfig) (*DeviceSetting, error) + type HTTPConfig struct + BindAddress string + CertFile string + KeyFile string + Password string + Username string + func (config *HTTPConfig) SpawnRoutine(vt *VirtualTun) + type HTTPServer struct + func (s *HTTPServer) ListenAndServe(network, addr string) error + type PeerConfig struct + AllowedIPs []netip.Prefix + Endpoint *string + KeepAlive int + PreSharedKey string + PublicKey string + type ResolveConfig struct + ResolveStrategy string + type RoutineSpawner interface + SpawnRoutine func(vt *VirtualTun) + type STDIOTunnelConfig struct + Input *os.File + Output *os.File + Target string + func (conf *STDIOTunnelConfig) SpawnRoutine(vt *VirtualTun) + type Socks5Config struct + BindAddress string + Password string + Username string + func (config *Socks5Config) SpawnRoutine(vt *VirtualTun) + type TCPClientTunnelConfig struct + BindAddress *net.TCPAddr + Target string + func (conf *TCPClientTunnelConfig) SpawnRoutine(vt *VirtualTun) + type TCPServerTunnelConfig struct + ListenPort int + Target string + func (conf *TCPServerTunnelConfig) SpawnRoutine(vt *VirtualTun) + type UDPProxyTunnelConfig struct + BindAddress string + InactivityTimeout int + Target string + func (conf *UDPProxyTunnelConfig) SpawnRoutine(vt *VirtualTun) + type VirtualTun struct + Conf *DeviceConfig + Dev *device.Device + PingRecord map[string]uint64 + PingRecordLock *sync.Mutex + ResolveConfig *ResolveConfig + SystemDNS bool + Tnet *netstack.Net + func StartWireguard(conf *Configuration, logLevel int) (*VirtualTun, error) + func (d VirtualTun) LookupAddr(ctx context.Context, name string) ([]string, error) + func (d VirtualTun) Resolve(ctx context.Context, name string) (context.Context, net.IP, error) + func (d VirtualTun) ResolveAddrWithContext(ctx context.Context, name string) (*netip.Addr, error) + func (d VirtualTun) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (d VirtualTun) StartPingIPs()