Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultOutbound = []OutboundRule{ { Port: "any", Proto: "any", Host: []string{"0.0.0.0/0"}, Action: "allow", }, } )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { //StaticHostMap map[string][]string `yaml:"static_host_map"` //Lighthouse LighthouseConfig `yaml:"lighthouse"` //Listen ListenConfig `yaml:"listen"` //Tun TunConfig `yaml:"tun"` //Handshake HandshakeConfig `yaml:"handshake"` //Outbound []OutboundRule `yaml:"outbound"` //Inbound []InboundRule `yaml:"inbound"` Persistence Persistence `yaml:"persistence"` Http HttpConfig `yaml:"http"` Email EmailConfig `yaml:"email"` }
type EmailConfig ¶
type HandshakeConfig ¶
type HandshakeConfig struct { HandshakeHost time.Duration SyncLighthouse time.Duration TryInterval time.Duration // 尝试间隔 Retries int // 尝试次数 TriggerBuffer int // 触发缓冲 UseRelays bool // 是否使用中继 }
HandshakeConfig 握手配置
type HostConfig ¶
type HostConfig struct { StaticHostMap map[string][]string `yaml:"static_host_map"` Lighthouse LighthouseConfig `yaml:"lighthouse"` Listen ListenConfig `yaml:"listen"` Tun TunConfig `yaml:"tun"` Handshake HandshakeConfig `yaml:"handshake"` Outbound []OutboundRule `yaml:"outbound"` Inbound []InboundRule `yaml:"inbound"` }
func GenerateConfigTemplate ¶
func GenerateConfigTemplate() HostConfig
GenerateConfigTemplate 生成通用配置模板
func GenerateLighthouseConfigTemplate ¶
func GenerateLighthouseConfigTemplate() HostConfig
type HttpConfig ¶
type InboundRule ¶
type InboundRule struct { Port string `yaml:"port"` Proto string `yaml:"proto"` Host []string `yaml:"host"` // "allow" or "deny" Action string `yaml:"action"` }
func (InboundRule) String ¶
func (r InboundRule) String() string
type LighthouseConfig ¶
type LighthouseConfig struct { Enabled bool `yaml:"enabled"` Interval int `yaml:"interval"` Hosts []string `yaml:"hosts"` LocalAllowList LocalAllowList `yaml:"local_allow_list"` }
type ListenConfig ¶
type LocalAllowList ¶
type OutboundRule ¶
type OutboundRule struct { Port string `yaml:"port"` Proto string `yaml:"proto"` Host []string `yaml:"host"` // "allow" or "deny" Action string `yaml:"action"` }
func (OutboundRule) String ¶
func (r OutboundRule) String() string
type Persistence ¶
type TunConfig ¶
type TunConfig struct { Disabled bool `yaml:"disabled"` // Dev Name of the device. If not set, a default will be chosen by the OS. // For macOS: if set, must be in the form `utun[0-9]+`. // For NetBSD: Required to be set, must be in the form `tun[0-9]+` Dev string `yaml:"dev"` IP string `yaml:"ip"` Mask string `yaml:"mask"` DropLocalBroadcast bool `yaml:"drop_local_broadcast"` DropMulticast bool `yaml:"drop_multicast"` TxQueue int `yaml:"tx_queue"` MTU int `yaml:"mtu"` }
Click to show internal directories.
Click to hide internal directories.