Documentation
¶
Index ¶
- Constants
- Variables
- func ParseRule(raw string) (string, error)
- func SplitRules(list []string) (cidrs, domains, keywords, names, paths []string)
- func ValidPort(port int) bool
- type Auth
- type General
- type Network
- type Node
- type NodeRef
- type Proto
- type Reality
- type Routing
- type Settings
- type ShadowTLS
- type TLS
- type Traffic
- type Transport
- type WireGuard
Constants ¶
View Source
const ( DefaultPort = 10808 DefaultDNS = "8.8.8.8" DefaultLogLevel = "error" DefaultTunMTU = 9000 DefaultTunStack = "gvisor" DefaultRefresh = 6 DefaultProbeURL = "http://www.gstatic.com/generate_204" TunInterface = "justray" )
View Source
const ( ProxyAll = "proxy all" DirectAll = "direct all" )
Variables ¶
Functions ¶
func SplitRules ¶
SplitRules splits entries into cidrs, domains, keywords, names and paths
Types ¶
type Auth ¶
type Auth struct {
UUID string `yaml:"uuid,omitempty"` // vmess, vless, tuic
Password string `yaml:"password,omitempty"` // trojan, ss, hysteria, anytls, tuic
Username string `yaml:"username,omitempty"` // socks, http
Method string `yaml:"method,omitempty"` // ss cipher, vmess security
Flow string `yaml:"flow,omitempty"` // vless, e.g. xtls
AlterID int `yaml:"alter_id,omitempty"` // legacy vmess
}
type General ¶
type General struct {
Autostart string `yaml:"-"` // on/off, kept by the OS
RefreshEvery int `yaml:"refresh_hours,omitempty"` // 0 = never
Port int `yaml:"port,omitempty"`
LogLevel string `yaml:"log_level,omitempty"`
ProbeURL string `yaml:"probe_url,omitempty"`
Emoji string `yaml:"emoji,omitempty"`
}
type Network ¶
type Network struct {
DNSHijack string `yaml:"dns_hijack,omitempty"` // on/off, empty = on
DNS string `yaml:"dns,omitempty"`
IPVersion string `yaml:"ip_version,omitempty"`
TunStack string `yaml:"stack,omitempty"`
TunMTU int `yaml:"mtu,omitempty"`
TunStrict string `yaml:"strict_route,omitempty"` // on/off, empty = on
}
type Node ¶
type Node struct {
ID string `yaml:"id"`
Name string `yaml:"name,omitempty"`
Protocol Proto `yaml:"protocol"`
Server string `yaml:"server"`
Port int `yaml:"port"`
Auth Auth `yaml:"auth,omitempty"`
Transport Transport `yaml:"transport,omitempty"`
TLS *TLS `yaml:"tls,omitempty"`
Reality *Reality `yaml:"reality,omitempty"`
Obfs string `yaml:"obfs,omitempty"` // hysteria2
ObfsPassword string `yaml:"obfs_password,omitempty"` // hysteria2, hysteria xplus
UpMbps int `yaml:"up_mbps,omitempty"` // hysteria
DownMbps int `yaml:"down_mbps,omitempty"` // hysteria
Congestion string `yaml:"congestion,omitempty"` // tuic
UDPRelayMode string `yaml:"udp_relay_mode,omitempty"` // tuic
PacketEncoding string `yaml:"packet_encoding,omitempty"` // vless, vmess: xudp, packetaddr; empty = xudp
ShadowTLS *ShadowTLS `yaml:"shadow_tls,omitempty"`
WireGuard *WireGuard `yaml:"wireguard,omitempty"`
}
type Routing ¶
type Routing struct {
Mode string `yaml:"mode,omitempty"` // proxy-all/direct-all, empty = proxy-all
BypassLocal string `yaml:"bypass_local,omitempty"` // on/off, empty = on
BlockQUIC string `yaml:"block_quic,omitempty"` // on/off, empty = off
Except []string `yaml:"except,omitempty"`
Blocked []string `yaml:"blocked,omitempty"`
}
type Settings ¶
type Transport ¶
type Transport struct {
Network string `yaml:"network,omitempty"` // tcp, ws, grpc, quic, xhttp
Path string `yaml:"path,omitempty"`
Host string `yaml:"host,omitempty"`
ServiceName string `yaml:"service_name,omitempty"` // grpc
Mode string `yaml:"mode,omitempty"` // xhttp: auto, packet-up, stream-up, stream-one
Extra string `yaml:"extra,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.