Versions in this module Expand all Collapse all v1 v1.9.3 May 5, 2024 v1.9.2 May 2, 2024 v1.9.2-rc.3 May 3, 2024 v1.9.2-rc.2 May 3, 2024 v1.9.2-rc.1 May 2, 2024 v1.9.1 May 2, 2024 Changes in this version + func DNSQueryTypeToString(queryType uint16) string + func MarshallObjects(objects ...any) ([]byte, error) + func MergeObjects(objects ...any) (*badjson.JSONObject, error) + func ToMap(v any) (*badjson.JSONObject, error) + func UnmarshallExcluded(inputContent []byte, parentObject any, object any) error + type ACMEDNS01AliDNSOptions struct + AccessKeyID string + AccessKeySecret string + RegionID string + type ACMEDNS01ChallengeOptions _ACMEDNS01ChallengeOptions + func (o *ACMEDNS01ChallengeOptions) UnmarshalJSON(bytes []byte) error + func (o ACMEDNS01ChallengeOptions) MarshalJSON() ([]byte, error) + type ACMEDNS01CloudflareOptions struct + APIToken string + type ACMEExternalAccountOptions struct + KeyID string + MACKey string + type BrutalOptions struct + DownMbps int + Enabled bool + UpMbps int + type CacheFileOptions struct + CacheID string + Enabled bool + Path string + RDRCTimeout Duration + StoreFakeIP bool + StoreRDRC bool + type ClashAPIOptions struct + CacheFile string + CacheID string + DefaultMode string + ExternalController string + ExternalUI string + ExternalUIDownloadDetour string + ExternalUIDownloadURL string + ModeList []string + Secret string + StoreFakeIP bool + StoreMode bool + StoreSelected bool + type DNSClientOptions struct + ClientSubnet *ListenAddress + DisableCache bool + DisableExpire bool + IndependentCache bool + Strategy DomainStrategy + type DNSFakeIPOptions struct + Enabled bool + Inet4Range *netip.Prefix + Inet6Range *netip.Prefix + type DNSOptions struct + FakeIP *DNSFakeIPOptions + Final string + ReverseMapping bool + Rules []DNSRule + Servers []DNSServerOptions + type DNSQueryType uint16 + func (t *DNSQueryType) UnmarshalJSON(bytes []byte) error + func (t DNSQueryType) MarshalJSON() ([]byte, error) + func (t DNSQueryType) String() string + type DNSRule _DNSRule + func (r *DNSRule) UnmarshalJSON(bytes []byte) error + func (r DNSRule) IsValid() bool + func (r DNSRule) MarshalJSON() ([]byte, error) + type DNSServerOptions struct + Address string + AddressFallbackDelay Duration + AddressResolver string + AddressStrategy DomainStrategy + ClientSubnet *ListenAddress + Detour string + Strategy DomainStrategy + Tag string + type DebugOptions struct + GCPercent *int + Listen string + MaxStack *int + MaxThreads *int + MemoryLimit MemoryBytes + OOMKiller *bool + PanicOnFault *bool + TraceBack string + type DefaultDNSRule struct + AuthUser Listable[string] + ClashMode string + ClientSubnet *ListenAddress + DisableCache bool + Domain Listable[string] + DomainKeyword Listable[string] + DomainRegex Listable[string] + DomainSuffix Listable[string] + GeoIP Listable[string] + Geosite Listable[string] + IPCIDR Listable[string] + IPIsPrivate bool + IPVersion int + Inbound Listable[string] + Invert bool + Network Listable[string] + Outbound Listable[string] + PackageName Listable[string] + Port Listable[uint16] + PortRange Listable[string] + ProcessName Listable[string] + ProcessPath Listable[string] + Protocol Listable[string] + QueryType Listable[DNSQueryType] + RewriteTTL *uint32 + RuleSet Listable[string] + RuleSetIPCIDRMatchSource bool + Server string + SourceGeoIP Listable[string] + SourceIPCIDR Listable[string] + SourceIPIsPrivate bool + SourcePort Listable[uint16] + SourcePortRange Listable[string] + User Listable[string] + UserID Listable[int32] + WIFIBSSID Listable[string] + WIFISSID Listable[string] + func (r DefaultDNSRule) IsValid() bool + type DefaultHeadlessRule struct + Domain Listable[string] + DomainKeyword Listable[string] + DomainMatcher *domain.Matcher + DomainRegex Listable[string] + DomainSuffix Listable[string] + IPCIDR Listable[string] + IPSet *netipx.IPSet + Invert bool + Network Listable[string] + PackageName Listable[string] + Port Listable[uint16] + PortRange Listable[string] + ProcessName Listable[string] + ProcessPath Listable[string] + QueryType Listable[DNSQueryType] + SourceIPCIDR Listable[string] + SourceIPSet *netipx.IPSet + SourcePort Listable[uint16] + SourcePortRange Listable[string] + WIFIBSSID Listable[string] + WIFISSID Listable[string] + func (r DefaultHeadlessRule) IsValid() bool + type DefaultRule struct + AuthUser Listable[string] + ClashMode string + Domain Listable[string] + DomainKeyword Listable[string] + DomainRegex Listable[string] + DomainSuffix Listable[string] + GeoIP Listable[string] + Geosite Listable[string] + IPCIDR Listable[string] + IPIsPrivate bool + IPVersion int + Inbound Listable[string] + Invert bool + Network Listable[string] + Outbound string + PackageName Listable[string] + Port Listable[uint16] + PortRange Listable[string] + ProcessName Listable[string] + ProcessPath Listable[string] + Protocol Listable[string] + RuleSet Listable[string] + RuleSetIPCIDRMatchSource bool + SourceGeoIP Listable[string] + SourceIPCIDR Listable[string] + SourceIPIsPrivate bool + SourcePort Listable[uint16] + SourcePortRange Listable[string] + User Listable[string] + UserID Listable[int32] + WIFIBSSID Listable[string] + WIFISSID Listable[string] + func (r DefaultRule) IsValid() bool + type DialerOptions struct + BindInterface string + ConnectTimeout Duration + Detour string + DomainStrategy DomainStrategy + FallbackDelay Duration + Inet4BindAddress *ListenAddress + Inet6BindAddress *ListenAddress + IsWireGuardListener bool + ProtectPath string + ReuseAddr bool + RoutingMark int + TCPFastOpen bool + TCPMultiPath bool + UDPFragment *bool + UDPFragmentDefault bool + func (o *DialerOptions) ReplaceDialerOptions(options DialerOptions) + func (o *DialerOptions) TakeDialerOptions() DialerOptions + type DialerOptionsWrapper interface + ReplaceDialerOptions func(options DialerOptions) + TakeDialerOptions func() DialerOptions + type DirectInboundOptions struct + Network NetworkList + OverrideAddress string + OverridePort uint16 + type DirectOutboundOptions struct + OverrideAddress string + OverridePort uint16 + ProxyProtocol uint8 + type DomainStrategy dns.DomainStrategy + func (s *DomainStrategy) UnmarshalJSON(bytes []byte) error + func (s DomainStrategy) MarshalJSON() ([]byte, error) + type Duration time.Duration + func ParseDuration(s string) (Duration, error) + func (d *Duration) UnmarshalJSON(bytes []byte) error + func (d Duration) MarshalJSON() ([]byte, error) + type ExperimentalOptions struct + CacheFile *CacheFileOptions + ClashAPI *ClashAPIOptions + Debug *DebugOptions + V2RayAPI *V2RayAPIOptions + type GeoIPOptions struct + DownloadDetour string + DownloadURL string + Path string + type GeositeOptions struct + DownloadDetour string + DownloadURL string + Path string + type HTTPHeader map[string]Listable[string] + func (h HTTPHeader) Build() http.Header + type HTTPMixedInboundOptions struct + SetSystemProxy bool + Users []auth.User + type HTTPOutboundOptions struct + Headers HTTPHeader + Password string + Path string + Username string + type HTTPProxyOptions struct + BypassDomain Listable[string] + Enabled bool + MatchDomain Listable[string] + type HeadlessRule _HeadlessRule + func (r *HeadlessRule) UnmarshalJSON(bytes []byte) error + func (r HeadlessRule) IsValid() bool + func (r HeadlessRule) MarshalJSON() ([]byte, error) + type Hysteria2InboundOptions struct + BrutalDebug bool + DownMbps int + IgnoreClientBandwidth bool + Masquerade string + Obfs *Hysteria2Obfs + UpMbps int + Users []Hysteria2User + type Hysteria2Obfs struct + Password string + Type string + type Hysteria2OutboundOptions struct + BrutalDebug bool + DownMbps int + Network NetworkList + Obfs *Hysteria2Obfs + Password string + UpMbps int + type Hysteria2User struct + Name string + Password string + type HysteriaInboundOptions struct + DisableMTUDiscovery bool + Down string + DownMbps int + MaxConnClient int + Obfs string + ReceiveWindowClient uint64 + ReceiveWindowConn uint64 + Up string + UpMbps int + Users []HysteriaUser + type HysteriaOutboundOptions struct + Auth []byte + AuthString string + DisableMTUDiscovery bool + Down string + DownMbps int + Network NetworkList + Obfs string + ReceiveWindow uint64 + ReceiveWindowConn uint64 + Up string + UpMbps int + type HysteriaUser struct + Auth []byte + AuthString string + Name string + type Inbound _Inbound + func (h *Inbound) RawOptions() (any, error) + func (h *Inbound) UnmarshalJSON(bytes []byte) error + func (h Inbound) MarshalJSON() ([]byte, error) + type InboundACMEOptions struct + AlternativeHTTPPort uint16 + AlternativeTLSPort uint16 + DNS01Challenge *ACMEDNS01ChallengeOptions + DataDirectory string + DefaultServerName string + DisableHTTPChallenge bool + DisableTLSALPNChallenge bool + Domain Listable[string] + Email string + ExternalAccount *ACMEExternalAccountOptions + Provider string + type InboundECHOptions struct + DynamicRecordSizingDisabled bool + Enabled bool + Key Listable[string] + KeyPath string + PQSignatureSchemesEnabled bool + type InboundMultiplexOptions struct + Brutal *BrutalOptions + Enabled bool + Padding bool + type InboundOptions struct + DomainStrategy DomainStrategy + SniffEnabled bool + SniffOverrideDestination bool + SniffTimeout Duration + UDPDisableDomainUnmapping bool + type InboundRealityHandshakeOptions struct + type InboundRealityOptions struct + Enabled bool + Handshake InboundRealityHandshakeOptions + MaxTimeDifference Duration + PrivateKey string + ShortID Listable[string] + type InboundTLSOptions struct + ACME *InboundACMEOptions + ALPN Listable[string] + Certificate Listable[string] + CertificatePath string + CipherSuites Listable[string] + ECH *InboundECHOptions + Enabled bool + Insecure bool + Key Listable[string] + KeyPath string + MaxVersion string + MinVersion string + Reality *InboundRealityOptions + ServerName string + type InboundTLSOptionsContainer struct + TLS *InboundTLSOptions + func (o *InboundTLSOptionsContainer) ReplaceInboundTLSOptions(options *InboundTLSOptions) + func (o *InboundTLSOptionsContainer) TakeInboundTLSOptions() *InboundTLSOptions + type InboundTLSOptionsWrapper interface + ReplaceInboundTLSOptions func(options *InboundTLSOptions) + TakeInboundTLSOptions func() *InboundTLSOptions + type Listable []T + func (l *Listable[T]) UnmarshalJSON(content []byte) error + func (l Listable[T]) MarshalJSON() ([]byte, error) + type ListenAddress netip.Addr + func NewListenAddress(addr netip.Addr) *ListenAddress + func (a *ListenAddress) Build() netip.Addr + func (a *ListenAddress) UnmarshalJSON(content []byte) error + func (a ListenAddress) MarshalJSON() ([]byte, error) + type ListenOptions struct + Detour string + Listen *ListenAddress + ListenPort uint16 + ProxyProtocol bool + ProxyProtocolAcceptNoHeader bool + TCPFastOpen bool + TCPMultiPath bool + UDPFragment *bool + UDPFragmentDefault bool + UDPTimeout UDPTimeoutCompat + func (o *ListenOptions) ReplaceListenOptions(options ListenOptions) + func (o *ListenOptions) TakeListenOptions() ListenOptions + type ListenOptionsWrapper interface + ReplaceListenOptions func(options ListenOptions) + TakeListenOptions func() ListenOptions + type LocalRuleSet struct + Path string + type LogOptions struct + DisableColor bool + Disabled bool + Level string + Output string + Timestamp bool + type LogicalDNSRule struct + ClientSubnet *ListenAddress + DisableCache bool + Invert bool + Mode string + RewriteTTL *uint32 + Rules []DNSRule + Server string + func (r LogicalDNSRule) IsValid() bool + type LogicalHeadlessRule struct + Invert bool + Mode string + Rules []HeadlessRule + func (r LogicalHeadlessRule) IsValid() bool + type LogicalRule struct + Invert bool + Mode string + Outbound string + Rules []Rule + func (r LogicalRule) IsValid() bool + type MemoryBytes uint64 + func (l *MemoryBytes) UnmarshalJSON(bytes []byte) error + func (l MemoryBytes) MarshalJSON() ([]byte, error) + type NTPOptions struct + Enabled bool + Interval Duration + WriteToSystem bool + type NaiveInboundOptions struct + Network NetworkList + Users []auth.User + type NetworkList string + func (v *NetworkList) UnmarshalJSON(content []byte) error + func (v NetworkList) Build() []string + type OnDemandOptions struct + Enabled bool + Rules []OnDemandRule + type OnDemandRule struct + Action *OnDemandRuleAction + DNSSearchDomainMatch Listable[string] + DNSServerAddressMatch Listable[string] + InterfaceTypeMatch *OnDemandRuleInterfaceType + ProbeURL string + SSIDMatch Listable[string] + type OnDemandRuleAction int + func (r *OnDemandRuleAction) MarshalJSON() ([]byte, error) + func (r *OnDemandRuleAction) UnmarshalJSON(bytes []byte) error + type OnDemandRuleInterfaceType int + func (r *OnDemandRuleInterfaceType) MarshalJSON() ([]byte, error) + func (r *OnDemandRuleInterfaceType) UnmarshalJSON(bytes []byte) error + type Options _Options + func (o *Options) UnmarshalJSON(content []byte) error + type Outbound _Outbound + func (h *Outbound) MarshalJSON() ([]byte, error) + func (h *Outbound) RawOptions() (any, error) + func (h *Outbound) UnmarshalJSON(bytes []byte) error + type OutboundECHOptions struct + Config Listable[string] + ConfigPath string + DynamicRecordSizingDisabled bool + Enabled bool + PQSignatureSchemesEnabled bool + type OutboundMultiplexOptions struct + Brutal *BrutalOptions + Enabled bool + MaxConnections int + MaxStreams int + MinStreams int + Padding bool + Protocol string + type OutboundRealityOptions struct + Enabled bool + PublicKey string + ShortID string + type OutboundTLSOptions struct + ALPN Listable[string] + Certificate Listable[string] + CertificatePath string + CipherSuites Listable[string] + DisableSNI bool + ECH *OutboundECHOptions + Enabled bool + Insecure bool + MaxVersion string + MinVersion string + Reality *OutboundRealityOptions + ServerName string + UTLS *OutboundUTLSOptions + type OutboundTLSOptionsContainer struct + TLS *OutboundTLSOptions + func (o *OutboundTLSOptionsContainer) ReplaceOutboundTLSOptions(options *OutboundTLSOptions) + func (o *OutboundTLSOptionsContainer) TakeOutboundTLSOptions() *OutboundTLSOptions + type OutboundTLSOptionsWrapper interface + ReplaceOutboundTLSOptions func(options *OutboundTLSOptions) + TakeOutboundTLSOptions func() *OutboundTLSOptions + type OutboundUTLSOptions struct + Enabled bool + Fingerprint string + type PlainRuleSet struct + Rules []HeadlessRule + type PlainRuleSetCompat _PlainRuleSetCompat + func (r *PlainRuleSetCompat) UnmarshalJSON(bytes []byte) error + func (r PlainRuleSetCompat) MarshalJSON() ([]byte, error) + func (r PlainRuleSetCompat) Upgrade() PlainRuleSet + type RedirectInboundOptions struct + type RemoteRuleSet struct + DownloadDetour string + URL string + UpdateInterval Duration + type RouteOptions struct + AutoDetectInterface bool + DefaultInterface string + DefaultMark int + Final string + FindProcess bool + GeoIP *GeoIPOptions + Geosite *GeositeOptions + OverrideAndroidVPN bool + RuleSet []RuleSet + Rules []Rule + type Rule _Rule + func (r *Rule) UnmarshalJSON(bytes []byte) error + func (r Rule) IsValid() bool + func (r Rule) MarshalJSON() ([]byte, error) + type RuleSet _RuleSet + func (r *RuleSet) UnmarshalJSON(bytes []byte) error + func (r RuleSet) MarshalJSON() ([]byte, error) + type SSHOutboundOptions struct + ClientVersion string + HostKey Listable[string] + HostKeyAlgorithms Listable[string] + Password string + PrivateKey Listable[string] + PrivateKeyPassphrase string + PrivateKeyPath string + User string + type SelectorOutboundOptions struct + Default string + InterruptExistConnections bool + Outbounds []string + type ServerOptions struct + Server string + ServerPort uint16 + func (o *ServerOptions) ReplaceServerOptions(options ServerOptions) + func (o *ServerOptions) TakeServerOptions() ServerOptions + func (o ServerOptions) Build() M.Socksaddr + type ServerOptionsWrapper interface + ReplaceServerOptions func(options ServerOptions) + TakeServerOptions func() ServerOptions + type ShadowTLSHandshakeOptions struct + type ShadowTLSInboundOptions struct + Handshake ShadowTLSHandshakeOptions + HandshakeForServerName map[string]ShadowTLSHandshakeOptions + Password string + StrictMode bool + Users []ShadowTLSUser + Version int + type ShadowTLSOutboundOptions struct + Password string + Version int + type ShadowTLSUser struct + Name string + Password string + type ShadowsocksDestination struct + Name string + Password string + type ShadowsocksInboundOptions struct + Destinations []ShadowsocksDestination + Method string + Multiplex *InboundMultiplexOptions + Network NetworkList + Password string + Users []ShadowsocksUser + type ShadowsocksOutboundOptions struct + Method string + Multiplex *OutboundMultiplexOptions + Network NetworkList + Password string + Plugin string + PluginOptions string + UDPOverTCP *UDPOverTCPOptions + type ShadowsocksROutboundOptions struct + Method string + Network NetworkList + Obfs string + ObfsParam string + Password string + Protocol string + ProtocolParam string + type ShadowsocksUser struct + Name string + Password string + type SocksInboundOptions struct + Users []auth.User + type SocksOutboundOptions struct + Network NetworkList + Password string + UDPOverTCP *UDPOverTCPOptions + Username string + Version string + type TProxyInboundOptions struct + Network NetworkList + type TUICInboundOptions struct + AuthTimeout Duration + CongestionControl string + Heartbeat Duration + Users []TUICUser + ZeroRTTHandshake bool + type TUICOutboundOptions struct + CongestionControl string + Heartbeat Duration + Network NetworkList + Password string + UDPOverStream bool + UDPRelayMode string + UUID string + ZeroRTTHandshake bool + type TUICUser struct + Name string + Password string + UUID string + type TorOutboundOptions struct + DataDirectory string + ExecutablePath string + ExtraArgs []string + Options map[string]string + type TrojanInboundOptions struct + Fallback *ServerOptions + FallbackForALPN map[string]*ServerOptions + Multiplex *InboundMultiplexOptions + Transport *V2RayTransportOptions + Users []TrojanUser + type TrojanOutboundOptions struct + Multiplex *OutboundMultiplexOptions + Network NetworkList + Password string + Transport *V2RayTransportOptions + type TrojanUser struct + Name string + Password string + type TunInboundOptions struct + AutoRoute bool + EndpointIndependentNat bool + ExcludeInterface Listable[string] + ExcludePackage Listable[string] + ExcludeUID Listable[uint32] + ExcludeUIDRange Listable[string] + GSO bool + IncludeAndroidUser Listable[int] + IncludeInterface Listable[string] + IncludePackage Listable[string] + IncludeUID Listable[uint32] + IncludeUIDRange Listable[string] + Inet4Address Listable[netip.Prefix] + Inet4RouteAddress Listable[netip.Prefix] + Inet4RouteExcludeAddress Listable[netip.Prefix] + Inet6Address Listable[netip.Prefix] + Inet6RouteAddress Listable[netip.Prefix] + Inet6RouteExcludeAddress Listable[netip.Prefix] + InterfaceName string + MTU uint32 + Platform *TunPlatformOptions + Stack string + StrictRoute bool + UDPTimeout UDPTimeoutCompat + type TunPlatformOptions struct + HTTPProxy *HTTPProxyOptions + type UDPOverTCPOptions _UDPOverTCPOptions + func (o *UDPOverTCPOptions) UnmarshalJSON(bytes []byte) error + func (o UDPOverTCPOptions) MarshalJSON() ([]byte, error) + type UDPTimeoutCompat Duration + func (c *UDPTimeoutCompat) UnmarshalJSON(data []byte) error + func (c UDPTimeoutCompat) MarshalJSON() ([]byte, error) + type URLTestOutboundOptions struct + IdleTimeout Duration + InterruptExistConnections bool + Interval Duration + Outbounds []string + Tolerance uint16 + URL string + type V2RayAPIOptions struct + Listen string + Stats *V2RayStatsServiceOptions + type V2RayGRPCOptions struct + ForceLite bool + IdleTimeout Duration + PermitWithoutStream bool + PingTimeout Duration + ServiceName string + type V2RayHTTPOptions struct + Headers HTTPHeader + Host Listable[string] + IdleTimeout Duration + Method string + Path string + PingTimeout Duration + type V2RayHTTPUpgradeOptions struct + Headers HTTPHeader + Host string + Path string + type V2RayQUICOptions struct + type V2RayStatsServiceOptions struct + Enabled bool + Inbounds []string + Outbounds []string + Users []string + type V2RayTransportOptions _V2RayTransportOptions + func (o *V2RayTransportOptions) UnmarshalJSON(bytes []byte) error + func (o V2RayTransportOptions) MarshalJSON() ([]byte, error) + type V2RayWebsocketOptions struct + EarlyDataHeaderName string + Headers HTTPHeader + MaxEarlyData uint32 + Path string + type VLESSInboundOptions struct + Multiplex *InboundMultiplexOptions + Transport *V2RayTransportOptions + Users []VLESSUser + type VLESSOutboundOptions struct + Flow string + Multiplex *OutboundMultiplexOptions + Network NetworkList + PacketEncoding *string + Transport *V2RayTransportOptions + UUID string + type VLESSUser struct + Flow string + Name string + UUID string + type VMessInboundOptions struct + Multiplex *InboundMultiplexOptions + Transport *V2RayTransportOptions + Users []VMessUser + type VMessOutboundOptions struct + AlterId int + AuthenticatedLength bool + GlobalPadding bool + Multiplex *OutboundMultiplexOptions + Network NetworkList + PacketEncoding string + Security string + Transport *V2RayTransportOptions + UUID string + type VMessUser struct + AlterId int + Name string + UUID string + type WireGuardOutboundOptions struct + GSO bool + InterfaceName string + LocalAddress Listable[netip.Prefix] + MTU uint32 + Network NetworkList + PeerPublicKey string + Peers []WireGuardPeer + PreSharedKey string + PrivateKey string + Reserved []uint8 + SystemInterface bool + Workers int + type WireGuardPeer struct + AllowedIPs Listable[string] + PreSharedKey string + PublicKey string + Reserved []uint8