Documentation
¶
Index ¶
- func MarshallObjects(objects ...any) ([]byte, error)
- func MergeObjects(objects ...any) (*badjson.JSONObject, error)
- func ParseTLSVersion(version string) (uint16, error)
- func ToMap(v any) (*badjson.JSONObject, error)
- func UnmarshallExcluded(inputContent []byte, parentObject any, object any) error
- type ClashAPIOptions
- type DNSClientOptions
- type DNSOptions
- type DNSRule
- type DNSServerOptions
- type DefaultDNSRule
- type DefaultRule
- type DialerOptions
- type DirectInboundOptions
- type DirectOutboundOptions
- type DomainStrategy
- type Duration
- type ExperimentalOptions
- type GeoIPOptions
- type GeositeOptions
- type HTTPMixedInboundOptions
- type HTTPOutboundOptions
- type Inbound
- type InboundOptions
- type InboundTLSOptions
- type Listable
- type ListenAddress
- type ListenOptions
- type ListenPrefix
- type LogOptions
- type LogicalDNSRule
- type LogicalRule
- type MultiplexOptions
- type NaiveInboundOptions
- type NetworkList
- type Options
- type Outbound
- type OutboundDialerOptions
- type OutboundTLSOptions
- type RedirectInboundOptions
- type RouteOptions
- type Rule
- type SelectorOutboundOptions
- type ServerOptions
- type ShadowsocksDestination
- type ShadowsocksInboundOptions
- type ShadowsocksOutboundOptions
- type ShadowsocksUser
- type SocksInboundOptions
- type SocksOutboundOptions
- type TProxyInboundOptions
- type TrojanInboundOptions
- type TrojanOutboundOptions
- type TrojanUser
- type TunInboundOptions
- type VMessInboundOptions
- type VMessOutboundOptions
- type VMessUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshallObjects ¶
func MergeObjects ¶
func MergeObjects(objects ...any) (*badjson.JSONObject, error)
func ParseTLSVersion ¶
Types ¶
type ClashAPIOptions ¶
type DNSClientOptions ¶
type DNSClientOptions struct { Strategy DomainStrategy `json:"strategy,omitempty"` DisableCache bool `json:"disable_cache,omitempty"` DisableExpire bool `json:"disable_expire,omitempty"` }
type DNSOptions ¶
type DNSOptions struct { Servers []DNSServerOptions `json:"servers,omitempty"` Rules []DNSRule `json:"rules,omitempty"` Final string `json:"final,omitempty"` DNSClientOptions }
type DNSServerOptions ¶
type DNSServerOptions struct { Tag string `json:"tag,omitempty"` Address string `json:"address"` AddressResolver string `json:"address_resolver,omitempty"` AddressStrategy DomainStrategy `json:"address_strategy,omitempty"` AddressFallbackDelay Duration `json:"address_fallback_delay,omitempty"` Detour string `json:"detour,omitempty"` }
type DefaultDNSRule ¶
type DefaultDNSRule struct { Inbound Listable[string] `json:"inbound,omitempty"` Network string `json:"network,omitempty"` AuthUser Listable[string] `json:"auth_user,omitempty"` Protocol Listable[string] `json:"protocol,omitempty"` Domain Listable[string] `json:"domain,omitempty"` DomainSuffix Listable[string] `json:"domain_suffix,omitempty"` DomainKeyword Listable[string] `json:"domain_keyword,omitempty"` DomainRegex Listable[string] `json:"domain_regex,omitempty"` Geosite Listable[string] `json:"geosite,omitempty"` SourceGeoIP Listable[string] `json:"source_geoip,omitempty"` SourceIPCIDR Listable[string] `json:"source_ip_cidr,omitempty"` SourcePort Listable[uint16] `json:"source_port,omitempty"` SourcePortRange Listable[string] `json:"source_port_range,omitempty"` Port Listable[uint16] `json:"port,omitempty"` PortRange Listable[string] `json:"port_range,omitempty"` ProcessName Listable[string] `json:"process_name,omitempty"` PackageName Listable[string] `json:"package_name,omitempty"` User Listable[string] `json:"user,omitempty"` UserID Listable[int32] `json:"user_id,omitempty"` Outbound Listable[string] `json:"outbound,omitempty"` Invert bool `json:"invert,omitempty"` Server string `json:"server,omitempty"` DisableCache bool `json:"disable_cache,omitempty"` }
func (DefaultDNSRule) IsValid ¶
func (r DefaultDNSRule) IsValid() bool
type DefaultRule ¶
type DefaultRule struct { Inbound Listable[string] `json:"inbound,omitempty"` IPVersion int `json:"ip_version,omitempty"` Network string `json:"network,omitempty"` AuthUser Listable[string] `json:"auth_user,omitempty"` Protocol Listable[string] `json:"protocol,omitempty"` Domain Listable[string] `json:"domain,omitempty"` DomainSuffix Listable[string] `json:"domain_suffix,omitempty"` DomainKeyword Listable[string] `json:"domain_keyword,omitempty"` DomainRegex Listable[string] `json:"domain_regex,omitempty"` Geosite Listable[string] `json:"geosite,omitempty"` SourceGeoIP Listable[string] `json:"source_geoip,omitempty"` GeoIP Listable[string] `json:"geoip,omitempty"` SourceIPCIDR Listable[string] `json:"source_ip_cidr,omitempty"` IPCIDR Listable[string] `json:"ip_cidr,omitempty"` SourcePort Listable[uint16] `json:"source_port,omitempty"` SourcePortRange Listable[string] `json:"source_port_range,omitempty"` Port Listable[uint16] `json:"port,omitempty"` PortRange Listable[string] `json:"port_range,omitempty"` ProcessName Listable[string] `json:"process_name,omitempty"` PackageName Listable[string] `json:"package_name,omitempty"` User Listable[string] `json:"user,omitempty"` UserID Listable[int32] `json:"user_id,omitempty"` Invert bool `json:"invert,omitempty"` Outbound string `json:"outbound,omitempty"` }
func (DefaultRule) IsValid ¶
func (r DefaultRule) IsValid() bool
type DialerOptions ¶
type DialerOptions struct { Detour string `json:"detour,omitempty"` BindInterface string `json:"bind_interface,omitempty"` ProtectPath string `json:"protect_path,omitempty"` RoutingMark int `json:"routing_mark,omitempty"` ReuseAddr bool `json:"reuse_addr,omitempty"` ConnectTimeout Duration `json:"connect_timeout,omitempty"` TCPFastOpen bool `json:"tcp_fast_open,omitempty"` }
type DirectInboundOptions ¶
type DirectInboundOptions struct { ListenOptions Network NetworkList `json:"network,omitempty"` OverrideAddress string `json:"override_address,omitempty"` OverridePort uint16 `json:"override_port,omitempty"` }
type DirectOutboundOptions ¶
type DirectOutboundOptions struct { OutboundDialerOptions OverrideAddress string `json:"override_address,omitempty"` OverridePort uint16 `json:"override_port,omitempty"` }
type DomainStrategy ¶
type DomainStrategy dns.DomainStrategy
func (DomainStrategy) MarshalJSON ¶
func (s DomainStrategy) MarshalJSON() ([]byte, error)
func (*DomainStrategy) UnmarshalJSON ¶
func (s *DomainStrategy) UnmarshalJSON(bytes []byte) error
type ExperimentalOptions ¶
type ExperimentalOptions struct {
ClashAPI *ClashAPIOptions `json:"clash_api,omitempty"`
}
type GeoIPOptions ¶
type GeositeOptions ¶
type HTTPMixedInboundOptions ¶
type HTTPMixedInboundOptions struct { ListenOptions Users []auth.User `json:"users,omitempty"` SetSystemProxy bool `json:"set_system_proxy,omitempty"` TLS *InboundTLSOptions `json:"tls,omitempty"` }
type HTTPOutboundOptions ¶
type HTTPOutboundOptions struct { OutboundDialerOptions ServerOptions Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` TLSOptions *OutboundTLSOptions `json:"tls,omitempty"` }
type InboundOptions ¶
type InboundOptions struct { SniffEnabled bool `json:"sniff,omitempty"` SniffOverrideDestination bool `json:"sniff_override_destination,omitempty"` DomainStrategy DomainStrategy `json:"domain_strategy,omitempty"` }
type InboundTLSOptions ¶
type InboundTLSOptions struct { Enabled bool `json:"enabled,omitempty"` ServerName string `json:"server_name,omitempty"` ALPN []string `json:"alpn,omitempty"` MinVersion string `json:"min_version,omitempty"` MaxVersion string `json:"max_version,omitempty"` CipherSuites []string `json:"cipher_suites,omitempty"` Certificate string `json:"certificate,omitempty"` CertificatePath string `json:"certificate_path,omitempty"` Key string `json:"key,omitempty"` KeyPath string `json:"key_path,omitempty"` }
type Listable ¶
type Listable[T comparable] []T
func (Listable[T]) MarshalJSON ¶
func (*Listable[T]) UnmarshalJSON ¶
type ListenAddress ¶
func (ListenAddress) MarshalJSON ¶
func (a ListenAddress) MarshalJSON() ([]byte, error)
func (*ListenAddress) UnmarshalJSON ¶
func (a *ListenAddress) UnmarshalJSON(content []byte) error
type ListenOptions ¶
type ListenOptions struct { Listen ListenAddress `json:"listen"` ListenPort uint16 `json:"listen_port,omitempty"` TCPFastOpen bool `json:"tcp_fast_open,omitempty"` UDPTimeout int64 `json:"udp_timeout,omitempty"` InboundOptions }
type ListenPrefix ¶
func (*ListenPrefix) Build ¶
func (p *ListenPrefix) Build() netip.Prefix
func (ListenPrefix) MarshalJSON ¶
func (p ListenPrefix) MarshalJSON() ([]byte, error)
func (*ListenPrefix) UnmarshalJSON ¶
func (p *ListenPrefix) UnmarshalJSON(bytes []byte) error
type LogOptions ¶
type LogicalDNSRule ¶
type LogicalDNSRule struct { Mode string `json:"mode"` Rules []DefaultDNSRule `json:"rules,omitempty"` Invert bool `json:"invert,omitempty"` Server string `json:"server,omitempty"` DisableCache bool `json:"disable_cache,omitempty"` }
func (LogicalDNSRule) IsValid ¶
func (r LogicalDNSRule) IsValid() bool
type LogicalRule ¶
type LogicalRule struct { Mode string `json:"mode"` Rules []DefaultRule `json:"rules,omitempty"` Invert bool `json:"invert,omitempty"` Outbound string `json:"outbound,omitempty"` }
func (LogicalRule) IsValid ¶
func (r LogicalRule) IsValid() bool
type MultiplexOptions ¶
type NaiveInboundOptions ¶
type NaiveInboundOptions struct { ListenOptions Users []auth.User `json:"users,omitempty"` Network NetworkList `json:"network,omitempty"` TLS *InboundTLSOptions `json:"tls,omitempty"` }
type NetworkList ¶
type NetworkList string
func (NetworkList) Build ¶
func (v NetworkList) Build() []string
func (*NetworkList) UnmarshalJSON ¶
func (v *NetworkList) UnmarshalJSON(content []byte) error
type Outbound ¶
type Outbound _Outbound
func (Outbound) MarshalJSON ¶
func (*Outbound) UnmarshalJSON ¶
type OutboundDialerOptions ¶
type OutboundDialerOptions struct { DialerOptions DomainStrategy DomainStrategy `json:"domain_strategy,omitempty"` FallbackDelay Duration `json:"fallback_delay,omitempty"` }
type OutboundTLSOptions ¶
type OutboundTLSOptions struct { Enabled bool `json:"enabled,omitempty"` DisableSNI bool `json:"disable_sni,omitempty"` ServerName string `json:"server_name,omitempty"` Insecure bool `json:"insecure,omitempty"` ALPN []string `json:"alpn,omitempty"` MinVersion string `json:"min_version,omitempty"` MaxVersion string `json:"max_version,omitempty"` CipherSuites []string `json:"cipher_suites,omitempty"` Certificate string `json:"certificate,omitempty"` CertificatePath string `json:"certificate_path,omitempty"` }
type RedirectInboundOptions ¶
type RedirectInboundOptions struct {
ListenOptions
}
type RouteOptions ¶
type RouteOptions struct { GeoIP *GeoIPOptions `json:"geoip,omitempty"` Geosite *GeositeOptions `json:"geosite,omitempty"` Rules []Rule `json:"rules,omitempty"` Final string `json:"final,omitempty"` FindProcess bool `json:"find_process,omitempty"` AutoDetectInterface bool `json:"auto_detect_interface,omitempty"` DefaultInterface string `json:"default_interface,omitempty"` DefaultMark int `json:"default_mark,omitempty"` }
type SelectorOutboundOptions ¶
type ServerOptions ¶
func (ServerOptions) Build ¶
func (o ServerOptions) Build() M.Socksaddr
type ShadowsocksDestination ¶
type ShadowsocksDestination struct { Name string `json:"name"` Password string `json:"password"` ServerOptions }
type ShadowsocksInboundOptions ¶
type ShadowsocksInboundOptions struct { ListenOptions Network NetworkList `json:"network,omitempty"` Method string `json:"method"` Password string `json:"password"` ControlPassword string `json:"control_password,omitempty"` Users []ShadowsocksUser `json:"users,omitempty"` Destinations []ShadowsocksDestination `json:"destinations,omitempty"` }
type ShadowsocksOutboundOptions ¶
type ShadowsocksOutboundOptions struct { OutboundDialerOptions ServerOptions Method string `json:"method"` Password string `json:"password"` Network NetworkList `json:"network,omitempty"` UoT bool `json:"udp_over_tcp,omitempty"` MultiplexOptions *MultiplexOptions `json:"multiplex,omitempty"` }
type ShadowsocksUser ¶
type SocksInboundOptions ¶
type SocksInboundOptions struct { ListenOptions Users []auth.User `json:"users,omitempty"` }
type SocksOutboundOptions ¶
type SocksOutboundOptions struct { OutboundDialerOptions ServerOptions Version string `json:"version,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Network NetworkList `json:"network,omitempty"` UoT bool `json:"udp_over_tcp,omitempty"` }
type TProxyInboundOptions ¶
type TProxyInboundOptions struct { ListenOptions Network NetworkList `json:"network,omitempty"` }
type TrojanInboundOptions ¶
type TrojanInboundOptions struct { ListenOptions Users []TrojanUser `json:"users,omitempty"` TLS *InboundTLSOptions `json:"tls,omitempty"` }
type TrojanOutboundOptions ¶
type TrojanOutboundOptions struct { OutboundDialerOptions ServerOptions Password string `json:"password"` Network NetworkList `json:"network,omitempty"` TLSOptions *OutboundTLSOptions `json:"tls,omitempty"` MultiplexOptions *MultiplexOptions `json:"multiplex,omitempty"` }
type TrojanUser ¶
type TunInboundOptions ¶
type TunInboundOptions struct { InterfaceName string `json:"interface_name,omitempty"` MTU uint32 `json:"mtu,omitempty"` Inet4Address *ListenPrefix `json:"inet4_address,omitempty"` Inet6Address *ListenPrefix `json:"inet6_address,omitempty"` AutoRoute bool `json:"auto_route,omitempty"` EndpointIndependentNat bool `json:"endpoint_independent_nat,omitempty"` UDPTimeout int64 `json:"udp_timeout,omitempty"` Stack string `json:"stack,omitempty"` InboundOptions }
type VMessInboundOptions ¶
type VMessInboundOptions struct { ListenOptions Users []VMessUser `json:"users,omitempty"` TLS *InboundTLSOptions `json:"tls,omitempty"` }
type VMessOutboundOptions ¶
type VMessOutboundOptions struct { OutboundDialerOptions ServerOptions UUID string `json:"uuid"` Security string `json:"security"` AlterId int `json:"alter_id,omitempty"` GlobalPadding bool `json:"global_padding,omitempty"` AuthenticatedLength bool `json:"authenticated_length,omitempty"` Network NetworkList `json:"network,omitempty"` TLSOptions *OutboundTLSOptions `json:"tls,omitempty"` MultiplexOptions *MultiplexOptions `json:"multiplex,omitempty"` }
Click to show internal directories.
Click to hide internal directories.