Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogEnabled ¶
func SetLogEnabled(enabled bool)
Types ¶
type DNSConfig ¶
type DNSConfig struct {
FakeDNS bool `json:"fake_dns"`
FakeDNSRange string `json:"fake_dns_range"`
}
DNSConfig defines DNS behavior.
type InboundConfig ¶
type InboundConfig struct {
TunName string `json:"tun_name"`
Inet4Address string `json:"inet4_address"`
MTU uint32 `json:"mtu"`
AutoRoute bool `json:"auto_route"`
StrictRoute bool `json:"strict_route"`
Sniff bool `json:"sniff"`
}
InboundConfig defines the TUN device settings.
type OutboundConfig ¶
type OutboundConfig struct {
Tag string `json:"tag"`
Type string `json:"type"`
Server string `json:"server,omitempty"`
Port uint16 `json:"port,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
OutboundConfig defines an outbound (direct / http / socks5).
type RouteConfig ¶
type RouteConfig struct {
Rules []RuleConfig `json:"rules"`
Final string `json:"final"`
DefaultInterface string `json:"default_interface,omitempty"`
}
RouteConfig holds routing rules and default outbound.
type RuleConfig ¶
type RuleConfig struct {
ProcessName []string `json:"process_name,omitempty"`
DomainSuffix []string `json:"domain_suffix,omitempty"`
Domain []string `json:"domain,omitempty"`
IPCidr []string `json:"ip_cidr,omitempty"`
Port []uint16 `json:"port,omitempty"`
Protocol string `json:"protocol,omitempty"`
Invert bool `json:"invert,omitempty"`
Outbound string `json:"outbound"`
}
RuleConfig defines a single routing rule.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server manages the TUN device lifecycle and traffic routing.
type TunConfig ¶
type TunConfig struct {
Enabled bool `json:"enabled"`
Inbound InboundConfig `json:"inbound"`
Outbounds []OutboundConfig `json:"outbounds"`
Route RouteConfig `json:"route"`
DNS DNSConfig `json:"dns"`
}
TunConfig is the top-level configuration for the TUN forwarder.
func DefaultConfig ¶
func DefaultConfig() *TunConfig
func LoadConfig ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.