Documentation
¶
Index ¶
Constants ¶
View Source
const ( RuleTypeAlways = "always" RuleTypeAnd = "and" RuleTypeOr = "or" RuleTypeServiceName = "ServiceName" RuleTypeSourceIPVersion = "SourceIPVersion" RuleTypeSourceIP = "SourceIP" RuleTypeSourcePort = "SourcePort" RuleTypeMinecraftHostname = "MinecraftHostname" RuleTypeMinecraftPlayerName = "MinecraftPlayerName" RuleTypeMinecraftStatus = "MinecraftStatus" RuleTypeMinecraftTransfer = "MinecraftTransfer" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MinecraftService ¶
type MinecraftService struct {
EnableHostnameRewrite bool `json:",omitempty"`
RewrittenHostname string `json:",omitempty"`
OnlineCount onlineCount
IgnoreFMLSuffix bool `json:",omitempty"`
IgnoreSRVRedirect bool `json:",omitempty"`
HostnameAccess access `json:",omitempty"`
NameAccess access `json:",omitempty"`
PingMode string
MotdFavicon string
MotdDescription string
}
type Outbound ¶
type Outbound struct {
Name string `json:",omitempty"`
Dialer string `json:",omitempty"`
TargetAddress string `json:",omitempty"`
TargetPort uint16 `json:",omitempty"`
Minecraft *MinecraftService `json:",omitempty"`
SocketOptions *network.OutboundSocketOptions `json:",omitempty"`
ProxyProtocolVersion int8 `json:",omitempty"`
ProxyOptions proxyOptions `json:",omitempty"`
}
type Root ¶
type Root struct {
Log Log
Services []*Service
Router Router
Outbounds []*Outbound
Lists map[string]set.StringSet
// contains filtered or unexported fields
}
func LoadConfigFromFile ¶
func (*Root) Reload ¶
Reload tries to reload the config and returns false if another reloading is on the way. Only takes effect when watcher is enabled.
func (*Root) SetUpdateHandler ¶
func (r *Root) SetUpdateHandler(handler func())
SetUpdateHandler sets a function that would be called after the config reloading.
func (*Root) WatcherEnabled ¶
type Rule ¶
type Rule struct {
Type string
Parameter json.RawMessage `json:",omitempty"`
//SubRules []Rule `json:",omitempty"`
Rewrite RuleRewrite `json:",omitempty"`
Sniff jsonx.Listable[string] `json:",omitempty"`
Outbound string `json:",omitempty"`
Invert bool `json:",omitempty"`
}
type RuleDomain ¶
type RuleParameterListableString ¶
type RuleParameterListableString _RuleParameterListableString
func (*RuleParameterListableString) UnmarshalJSON ¶
func (r *RuleParameterListableString) UnmarshalJSON(bytes []byte) error
type RuleRewrite ¶
type Service ¶
type Service struct {
Name string
TargetAddress string `json:",omitempty"`
TargetPort uint16 `json:",omitempty"`
Listen uint16
EnableProxyProtocol bool `json:",omitempty"`
IPAccess access `json:",omitempty"`
Minecraft *MinecraftService `json:",omitempty"`
TLSSniffing *tlsSniffing `json:",omitempty"`
SocketOptions *network.InboundSocketOptions `json:",omitempty"`
Outbound proxyOptions `json:",omitempty"`
}
Click to show internal directories.
Click to hide internal directories.