Help us shape the future of Go! Take the 2026 Go Developer Survey

option

package
v1.14.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: GPL-2.0 Imports: 34 Imported by: 322

Documentation

Index

Constants

View Source
const (
	ACMEKeyTypeED25519 = ACMEKeyType("ed25519")
	ACMEKeyTypeP256    = ACMEKeyType("p256")
	ACMEKeyTypeP384    = ACMEKeyType("p384")
	ACMEKeyTypeRSA2048 = ACMEKeyType("rsa2048")
	ACMEKeyTypeRSA4096 = ACMEKeyType("rsa4096")
)
View Source
const (
	CloudflareOriginCARequestTypeOriginRSA = CloudflareOriginCARequestType("origin-rsa")
	CloudflareOriginCARequestTypeOriginECC = CloudflareOriginCARequestType("origin-ecc")
)
View Source
const (
	CloudflareOriginCARequestValidity7    = CloudflareOriginCARequestValidity(7)
	CloudflareOriginCARequestValidity30   = CloudflareOriginCARequestValidity(30)
	CloudflareOriginCARequestValidity90   = CloudflareOriginCARequestValidity(90)
	CloudflareOriginCARequestValidity365  = CloudflareOriginCARequestValidity(365)
	CloudflareOriginCARequestValidity730  = CloudflareOriginCARequestValidity(730)
	CloudflareOriginCARequestValidity1095 = CloudflareOriginCARequestValidity(1095)
	CloudflareOriginCARequestValidity5475 = CloudflareOriginCARequestValidity(5475)
)
View Source
const (
	RouteRuleActionNestedUnsupportedMessage = "rule action is not supported in nested rules"
	DNSRuleActionNestedUnsupportedMessage   = "DNS rule action is not supported in nested rules"
)
View Source
const (
	CurveP256      = 23
	CurveP384      = 24
	CurveP521      = 25
	X25519         = 29
	X25519MLKEM768 = 4588
)
View Source
const (
	USBIPProviderDefault = "default"
	USBIPProviderDynamic = "dynamic"
)

Variables

This section is empty.

Functions

func DNSQueryTypeToString added in v1.2.0

func DNSQueryTypeToString(queryType uint16) string

Types

type ACMECertificateProviderOptions added in v1.14.0

type ACMECertificateProviderOptions struct {
	Domain                  badoption.Listable[string]         `json:"domain,omitempty"`
	DataDirectory           string                             `json:"data_directory,omitempty"`
	DefaultServerName       string                             `json:"default_server_name,omitempty"`
	Email                   string                             `json:"email,omitempty"`
	Provider                string                             `json:"provider,omitempty"`
	AccountKey              string                             `json:"account_key,omitempty"`
	DisableHTTPChallenge    bool                               `json:"disable_http_challenge,omitempty"`
	DisableTLSALPNChallenge bool                               `json:"disable_tls_alpn_challenge,omitempty"`
	AlternativeHTTPPort     uint16                             `json:"alternative_http_port,omitempty"`
	AlternativeTLSPort      uint16                             `json:"alternative_tls_port,omitempty"`
	ExternalAccount         *ACMEExternalAccountOptions        `json:"external_account,omitempty"`
	DNS01Challenge          *ACMEProviderDNS01ChallengeOptions `json:"dns01_challenge,omitempty"`
	KeyType                 ACMEKeyType                        `json:"key_type,omitempty" enum:"ed25519,p256,p384,rsa2048,rsa4096"`
	Profile                 string                             `json:"profile,omitempty"`
	HTTPClient              *HTTPClientOptions                 `json:"http_client,omitempty"`
}

type ACMEDNS01ACMEDNSOptions added in v1.13.0

type ACMEDNS01ACMEDNSOptions struct {
	Username  string `json:"username,omitempty"`
	Password  string `json:"password,omitempty"`
	Subdomain string `json:"subdomain,omitempty"`
	ServerURL string `json:"server_url,omitempty"`
}

type ACMEDNS01AliDNSOptions added in v1.5.0

type ACMEDNS01AliDNSOptions struct {
	AccessKeyID     string `json:"access_key_id,omitempty"`
	AccessKeySecret string `json:"access_key_secret,omitempty"`
	RegionID        string `json:"region_id,omitempty"`
	SecurityToken   string `json:"security_token,omitempty"`
}

type ACMEDNS01ChallengeOptions added in v1.5.0

type ACMEDNS01ChallengeOptions _ACMEDNS01ChallengeOptions

func (ACMEDNS01ChallengeOptions) DescribeSchema added in v1.14.0

func (o ACMEDNS01ChallengeOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (ACMEDNS01ChallengeOptions) MarshalJSON added in v1.5.0

func (o ACMEDNS01ChallengeOptions) MarshalJSON() ([]byte, error)

func (*ACMEDNS01ChallengeOptions) UnmarshalJSON added in v1.5.0

func (o *ACMEDNS01ChallengeOptions) UnmarshalJSON(bytes []byte) error

type ACMEDNS01CloudflareOptions added in v1.5.0

type ACMEDNS01CloudflareOptions struct {
	APIToken  string `json:"api_token,omitempty"`
	ZoneToken string `json:"zone_token,omitempty"`
}

type ACMEExternalAccountOptions added in v1.0.1

type ACMEExternalAccountOptions struct {
	KeyID  string `json:"key_id,omitempty"`
	MACKey string `json:"mac_key,omitempty"`
}

type ACMEKeyType added in v1.14.0

type ACMEKeyType string

func (ACMEKeyType) DescribeSchema added in v1.14.0

func (t ACMEKeyType) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*ACMEKeyType) UnmarshalJSON added in v1.14.0

func (t *ACMEKeyType) UnmarshalJSON(data []byte) error

type ACMEProviderDNS01ChallengeOptions added in v1.14.0

type ACMEProviderDNS01ChallengeOptions _ACMEProviderDNS01ChallengeOptions

func (ACMEProviderDNS01ChallengeOptions) DescribeSchema added in v1.14.0

func (o ACMEProviderDNS01ChallengeOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (ACMEProviderDNS01ChallengeOptions) MarshalJSON added in v1.14.0

func (o ACMEProviderDNS01ChallengeOptions) MarshalJSON() ([]byte, error)

func (*ACMEProviderDNS01ChallengeOptions) UnmarshalJSON added in v1.14.0

func (o *ACMEProviderDNS01ChallengeOptions) UnmarshalJSON(bytes []byte) error

type APIDashboardOptions added in v1.14.0

type APIDashboardOptions _APIDashboardOptions

func (APIDashboardOptions) DescribeSchema added in v1.14.0

func (o APIDashboardOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (APIDashboardOptions) MarshalJSON added in v1.14.0

func (o APIDashboardOptions) MarshalJSON() ([]byte, error)

func (*APIDashboardOptions) UnmarshalJSON added in v1.14.0

func (o *APIDashboardOptions) UnmarshalJSON(bytes []byte) error

type APIServiceOptions added in v1.14.0

type APIServiceOptions struct {
	ListenOptions
	Secret                           string                     `json:"secret,omitempty"`
	AccessControlAllowOrigin         badoption.Listable[string] `` /* 136-byte string literal not displayed */
	AccessControlAllowPrivateNetwork bool                       `json:"access_control_allow_private_network,omitempty"`
	Dashboard                        *APIDashboardOptions       `json:"dashboard,omitempty"`
	InboundTLSOptionsContainer
}

type AbstractACMEProviderDNS01ChallengeOptions added in v1.14.0

type AbstractACMEProviderDNS01ChallengeOptions struct {
	TTL                badoption.Duration         `json:"ttl,omitempty"`
	PropagationDelay   badoption.Duration         `json:"propagation_delay,omitempty"`
	PropagationTimeout badoption.Duration         `json:"propagation_timeout,omitempty"`
	Resolvers          badoption.Listable[string] `json:"resolvers,omitempty"`
	OverrideDomain     string                     `json:"override_domain,omitempty"`
}

type AbstractDNSRouteActionOptions added in v1.14.0

type AbstractDNSRouteActionOptions struct {
	Timeout                badoption.Duration    `json:"timeout,omitempty"`
	Strategy               DomainStrategy        `json:"strategy,omitempty" schema:"omit"`
	DisableCache           bool                  `json:"disable_cache,omitempty"`
	DisableOptimisticCache bool                  `json:"disable_optimistic_cache,omitempty"`
	RewriteTTL             *uint32               `json:"rewrite_ttl,omitempty"`
	ClientSubnet           *badoption.Prefixable `json:"client_subnet,omitempty"`
	RemoveClientSubnet     bool                  `json:"remove_client_subnet,omitempty"`
}

type AbstractDialerOptions added in v1.14.0

type AbstractDialerOptions struct {
	BindInterface              string                            `json:"bind_interface,omitempty"`
	Inet4BindAddress           *badoption.Addr                   `json:"inet4_bind_address,omitempty"`
	Inet6BindAddress           *badoption.Addr                   `json:"inet6_bind_address,omitempty"`
	BindAddressNoPort          bool                              `json:"bind_address_no_port,omitempty"`
	ProtectPath                string                            `json:"protect_path,omitempty"`
	RoutingMark                FwMark                            `json:"routing_mark,omitempty"`
	ReuseAddr                  bool                              `json:"reuse_addr,omitempty"`
	NetNs                      string                            `json:"netns,omitempty" reference:"network_namespace"`
	ConnectTimeout             badoption.Duration                `json:"connect_timeout,omitempty"`
	TCPFastOpen                bool                              `json:"tcp_fast_open,omitempty"`
	TCPMultiPath               bool                              `json:"tcp_multi_path,omitempty"`
	DisableTCPKeepAlive        bool                              `json:"disable_tcp_keep_alive,omitempty"`
	TCPKeepAlive               badoption.Duration                `json:"tcp_keep_alive,omitempty"`
	TCPKeepAliveInterval       badoption.Duration                `json:"tcp_keep_alive_interval,omitempty"`
	TCPKeepAliveSystemDefaults bool                              `json:"-"`
	UDPBindPort                uint16                            `json:"-"`
	UDPFragment                *bool                             `json:"udp_fragment,omitempty"`
	UDPFragmentDefault         bool                              `json:"-"`
	DomainResolver             *DomainResolveOptions             `json:"domain_resolver,omitempty"`
	NetworkStrategy            *NetworkStrategy                  `json:"network_strategy,omitempty"`
	NetworkType                badoption.Listable[InterfaceType] `json:"network_type,omitempty"`
	FallbackNetworkType        badoption.Listable[InterfaceType] `json:"fallback_network_type,omitempty"`
	FallbackDelay              badoption.Duration                `json:"fallback_delay,omitempty"`

	// Deprecated: migrated to domain resolver
	DomainStrategy DomainStrategy `json:"domain_strategy,omitempty" schema:"omit"`
}

type AbstractSnellInboundOptions added in v1.14.0

type AbstractSnellInboundOptions struct {
	ListenOptions
	PSK   string      `json:"psk"`
	Users []SnellUser `json:"users,omitempty"`
}

type AbstractSnellOutboundOptions added in v1.14.0

type AbstractSnellOutboundOptions struct {
	DialerOptions
	ServerOptions
	PSK     string      `json:"psk"`
	UserKey string      `json:"userkey,omitempty"`
	Reuse   bool        `json:"reuse,omitempty"`
	Network NetworkList `json:"network,omitempty"`
}

type AnyTLSInboundOptions added in v1.11.10

type AnyTLSInboundOptions struct {
	ListenOptions
	InboundTLSOptionsContainer
	Users         []AnyTLSUser               `json:"users,omitempty"`
	PaddingScheme badoption.Listable[string] `json:"padding_scheme,omitempty"`
}

type AnyTLSOutboundOptions added in v1.11.10

type AnyTLSOutboundOptions struct {
	DialerOptions
	ServerOptions
	OutboundTLSOptionsContainer
	Password                 string             `json:"password,omitempty"`
	IdleSessionCheckInterval badoption.Duration `json:"idle_session_check_interval,omitempty"`
	IdleSessionTimeout       badoption.Duration `json:"idle_session_timeout,omitempty"`
	MinIdleSession           int                `json:"min_idle_session,omitempty"`
	ClientMetadata           string             `json:"client_metadata,omitempty"`
}

type AnyTLSUser added in v1.11.10

type AnyTLSUser struct {
	Name     string `json:"name,omitempty"`
	Password string `json:"password,omitempty"`
}

type BridgeOutboundOptions added in v1.14.0

type BridgeOutboundOptions struct {
	Interface          string `json:"interface,omitempty"`
	BridgeName         string `json:"bridge_name,omitempty"`
	IPRoute2TableIndex int    `json:"iproute2_table_index,omitempty"`
	IPRoute2RuleIndex  int    `json:"iproute2_rule_index,omitempty"`
}

type BrutalOptions added in v1.7.0

type BrutalOptions struct {
	Enabled  bool `json:"enabled,omitempty"`
	UpMbps   int  `json:"up_mbps,omitempty"`
	DownMbps int  `json:"down_mbps,omitempty"`
}

type CCMServiceOptions added in v1.13.0

type CCMServiceOptions struct {
	ListenOptions
	InboundTLSOptionsContainer
	CredentialPath string               `json:"credential_path,omitempty"`
	Users          []CCMUser            `json:"users,omitempty"`
	Headers        badoption.HTTPHeader `json:"headers,omitempty"`
	Detour         string               `json:"detour,omitempty" reference:"outbound"`
	UsagesPath     string               `json:"usages_path,omitempty"`
}

type CCMUser added in v1.13.0

type CCMUser struct {
	Name  string `json:"name,omitempty"`
	Token string `json:"token,omitempty"`
}

type CacheFileOptions added in v1.8.0

type CacheFileOptions struct {
	Enabled     bool               `json:"enabled,omitempty"`
	Path        string             `json:"path,omitempty"`
	CacheID     string             `json:"cache_id,omitempty"`
	StoreFakeIP bool               `json:"store_fakeip,omitempty"`
	StoreRDRC   bool               `json:"store_rdrc,omitempty" schema:"omit"`
	RDRCTimeout badoption.Duration `json:"rdrc_timeout,omitempty"`
	StoreDNS    bool               `json:"store_dns,omitempty"`
}

type CertificateOptions added in v1.11.10

type CertificateOptions _CertificateOptions

func (CertificateOptions) DescribeSchema added in v1.14.0

func (o CertificateOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (CertificateOptions) MarshalJSON added in v1.11.10

func (o CertificateOptions) MarshalJSON() ([]byte, error)

func (*CertificateOptions) UnmarshalJSON added in v1.11.10

func (o *CertificateOptions) UnmarshalJSON(data []byte) error

type CertificateProvider added in v1.14.0

type CertificateProvider _CertificateProvider

func (CertificateProvider) DescribeSchema added in v1.14.0

func (h CertificateProvider) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*CertificateProvider) MarshalJSONContext added in v1.14.0

func (h *CertificateProvider) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*CertificateProvider) UnmarshalJSONContext added in v1.14.0

func (h *CertificateProvider) UnmarshalJSONContext(ctx context.Context, content []byte) error

type CertificateProviderOptions added in v1.14.0

type CertificateProviderOptions struct {
	Tag     string `json:"-"`
	Type    string `json:"-"`
	Options any    `json:"-"`
}

func (CertificateProviderOptions) DescribeSchema added in v1.14.0

func (o CertificateProviderOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*CertificateProviderOptions) IsShared added in v1.14.0

func (o *CertificateProviderOptions) IsShared() bool

func (*CertificateProviderOptions) MarshalJSONContext added in v1.14.0

func (o *CertificateProviderOptions) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*CertificateProviderOptions) UnmarshalJSONContext added in v1.14.0

func (o *CertificateProviderOptions) UnmarshalJSONContext(ctx context.Context, content []byte) error

type CertificateProviderOptionsRegistry added in v1.14.0

type CertificateProviderOptionsRegistry interface {
	OptionTypes() []string
	CreateOptions(providerType string) (any, bool)
}

type ClashAPIOptions

type ClashAPIOptions struct {
	ExternalController               string                     `json:"external_controller,omitempty"`
	ExternalUI                       string                     `json:"external_ui,omitempty"`
	ExternalUIDownloadURL            string                     `json:"external_ui_download_url,omitempty"`
	ExternalUIDownloadDetour         string                     `json:"external_ui_download_detour,omitempty" reference:"outbound"`
	Secret                           string                     `json:"secret,omitempty"`
	DefaultMode                      string                     `json:"default_mode,omitempty"`
	AccessControlAllowOrigin         badoption.Listable[string] `json:"access_control_allow_origin,omitempty"`
	AccessControlAllowPrivateNetwork bool                       `json:"access_control_allow_private_network,omitempty"`

	// Deprecated: migrated to global cache file
	CacheFile string `json:"cache_file,omitempty" schema:"omit"`
	// Deprecated: migrated to global cache file
	CacheID string `json:"cache_id,omitempty" schema:"omit"`
	// Deprecated: migrated to global cache file
	StoreMode bool `json:"store_mode,omitempty" schema:"omit"`
	// Deprecated: migrated to global cache file
	StoreSelected bool `json:"store_selected,omitempty" schema:"omit"`
	// Deprecated: migrated to global cache file
	StoreFakeIP bool `json:"store_fakeip,omitempty" schema:"omit"`
}

type ClientAuthType added in v1.13.0

type ClientAuthType tls.ClientAuthType

func (ClientAuthType) DescribeSchema added in v1.14.0

func (t ClientAuthType) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (ClientAuthType) MarshalJSON added in v1.13.0

func (t ClientAuthType) MarshalJSON() ([]byte, error)

func (*ClientAuthType) UnmarshalJSON added in v1.13.0

func (t *ClientAuthType) UnmarshalJSON(data []byte) error

type CloudflareOriginCACertificateProviderOptions added in v1.14.0

type CloudflareOriginCACertificateProviderOptions struct {
	Domain            badoption.Listable[string]        `json:"domain,omitempty"`
	DataDirectory     string                            `json:"data_directory,omitempty"`
	APIToken          string                            `json:"api_token,omitempty"`
	OriginCAKey       string                            `json:"origin_ca_key,omitempty"`
	RequestType       CloudflareOriginCARequestType     `json:"request_type,omitempty" enum:"origin-rsa,origin-ecc"`
	RequestedValidity CloudflareOriginCARequestValidity `json:"requested_validity,omitempty" enum:"0,7,30,90,365,730,1095,5475"`
	HTTPClient        *HTTPClientOptions                `json:"http_client,omitempty"`
}

type CloudflareOriginCARequestType added in v1.14.0

type CloudflareOriginCARequestType string

func (CloudflareOriginCARequestType) DescribeSchema added in v1.14.0

func (t CloudflareOriginCARequestType) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*CloudflareOriginCARequestType) UnmarshalJSON added in v1.14.0

func (t *CloudflareOriginCARequestType) UnmarshalJSON(data []byte) error

type CloudflareOriginCARequestValidity added in v1.14.0

type CloudflareOriginCARequestValidity uint16

func (CloudflareOriginCARequestValidity) DescribeSchema added in v1.14.0

func (v CloudflareOriginCARequestValidity) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*CloudflareOriginCARequestValidity) UnmarshalJSON added in v1.14.0

func (v *CloudflareOriginCARequestValidity) UnmarshalJSON(data []byte) error

type CloudflaredInboundOptions added in v1.14.0

type CloudflaredInboundOptions struct {
	Token                       string             `json:"token,omitempty"`
	HighAvailabilityConnections int                `json:"ha_connections,omitempty"`
	Protocol                    string             `json:"protocol,omitempty" enum:"auto,quic,http2,h2mux"`
	PostQuantum                 bool               `json:"post_quantum,omitempty"`
	EdgeIPVersion               int                `json:"edge_ip_version,omitempty" enum:"0,4,6"`
	DatagramVersion             string             `json:"datagram_version,omitempty" enum:"v2,v3"`
	GracePeriod                 badoption.Duration `json:"grace_period,omitempty"`
	Region                      string             `json:"region,omitempty"`
	ControlDialer               DialerOptions      `json:"control_dialer,omitempty"`
	TunnelDialer                DialerOptions      `json:"tunnel_dialer,omitempty"`
}

type CurvePreference added in v1.13.0

type CurvePreference tls.CurveID

func (CurvePreference) DescribeSchema added in v1.14.0

func (c CurvePreference) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (CurvePreference) MarshalJSON added in v1.13.0

func (c CurvePreference) MarshalJSON() ([]byte, error)

func (*CurvePreference) UnmarshalJSON added in v1.13.0

func (c *CurvePreference) UnmarshalJSON(data []byte) error

type DERPMeshOptions added in v1.12.0

type DERPMeshOptions struct {
	ServerOptions
	Host string `json:"host,omitempty"`
	OutboundTLSOptionsContainer
	DialerOptions
}

type DERPSTUNListenOptions added in v1.12.0

type DERPSTUNListenOptions _DERPSTUNListenOptions

func (DERPSTUNListenOptions) DescribeSchema added in v1.14.0

func (d DERPSTUNListenOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (DERPSTUNListenOptions) MarshalJSON added in v1.12.0

func (d DERPSTUNListenOptions) MarshalJSON() ([]byte, error)

func (*DERPSTUNListenOptions) UnmarshalJSON added in v1.12.0

func (d *DERPSTUNListenOptions) UnmarshalJSON(bytes []byte) error

type DERPServiceOptions added in v1.12.0

type DERPServiceOptions struct {
	ListenOptions
	InboundTLSOptionsContainer
	ConfigPath           string                                          `json:"config_path,omitempty"`
	VerifyClientEndpoint badoption.Listable[string]                      `json:"verify_client_endpoint,omitempty"`
	VerifyClientURL      badoption.Listable[*DERPVerifyClientURLOptions] `json:"verify_client_url,omitempty"`
	Home                 string                                          `json:"home,omitempty"`
	MeshWith             badoption.Listable[*DERPMeshOptions]            `json:"mesh_with,omitempty"`
	MeshPSK              string                                          `json:"mesh_psk,omitempty"`
	MeshPSKFile          string                                          `json:"mesh_psk_file,omitempty"`
	STUN                 *DERPSTUNListenOptions                          `json:"stun,omitempty"`
}

type DERPVerifyClientURLOptions added in v1.12.0

type DERPVerifyClientURLOptions _DERPVerifyClientURLOptions

func (DERPVerifyClientURLOptions) DescribeSchema added in v1.14.0

func (d DERPVerifyClientURLOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (DERPVerifyClientURLOptions) MarshalJSON added in v1.12.0

func (d DERPVerifyClientURLOptions) MarshalJSON() ([]byte, error)

func (DERPVerifyClientURLOptions) ServerIsDomain added in v1.12.0

func (d DERPVerifyClientURLOptions) ServerIsDomain() bool

func (*DERPVerifyClientURLOptions) UnmarshalJSON added in v1.12.0

func (d *DERPVerifyClientURLOptions) UnmarshalJSON(bytes []byte) error

type DHCPDNSServerOptions added in v1.11.10

type DHCPDNSServerOptions struct {
	LocalDNSServerOptions
	Interface string `json:"interface,omitempty"`
}

type DNSClientOptions

type DNSClientOptions struct {
	Strategy         DomainStrategy        `json:"strategy,omitempty"`
	Timeout          badoption.Duration    `json:"timeout,omitempty"`
	DisableCache     bool                  `json:"disable_cache,omitempty"`
	DisableExpire    bool                  `json:"disable_expire,omitempty"`
	IndependentCache bool                  `json:"independent_cache,omitempty" schema:"omit"`
	CacheCapacity    uint32                `json:"cache_capacity,omitempty"`
	Optimistic       *OptimisticDNSOptions `json:"optimistic,omitempty"`
	ClientSubnet     *badoption.Prefixable `json:"client_subnet,omitempty"`
}

type DNSEvaluateActionOptions added in v1.14.0

type DNSEvaluateActionOptions struct {
	Server      string `json:"server,omitempty" reference:"dns_server"`
	Tag         string `json:"tag,omitempty"`
	Speculative bool   `json:"speculative,omitempty"`
	AbstractDNSRouteActionOptions
}

type DNSOptions

type DNSOptions struct {
	RawDNSOptions
}

func (DNSOptions) DescribeSchema added in v1.14.0

func (o DNSOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*DNSOptions) UnmarshalJSONContext added in v1.11.10

func (o *DNSOptions) UnmarshalJSONContext(ctx context.Context, content []byte) error

type DNSQueryType added in v1.2.0

type DNSQueryType uint16

func (DNSQueryType) DescribeSchema added in v1.14.0

func (t DNSQueryType) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (DNSQueryType) MarshalJSON added in v1.2.0

func (t DNSQueryType) MarshalJSON() ([]byte, error)

func (DNSQueryType) String added in v1.8.0

func (t DNSQueryType) String() string

func (*DNSQueryType) UnmarshalJSON added in v1.2.0

func (t *DNSQueryType) UnmarshalJSON(bytes []byte) error

type DNSRCode added in v1.11.10

type DNSRCode int

func (*DNSRCode) Build added in v1.11.10

func (r *DNSRCode) Build() int

func (DNSRCode) DescribeSchema added in v1.14.0

func (r DNSRCode) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (DNSRCode) MarshalJSON added in v1.11.10

func (r DNSRCode) MarshalJSON() ([]byte, error)

func (*DNSRCode) UnmarshalJSON added in v1.11.10

func (r *DNSRCode) UnmarshalJSON(bytes []byte) error

type DNSRecordOptions added in v1.11.10

type DNSRecordOptions struct {
	dns.RR
	// contains filtered or unexported fields
}

func (DNSRecordOptions) Build added in v1.11.10

func (o DNSRecordOptions) Build() dns.RR

func (DNSRecordOptions) DescribeSchema added in v1.14.0

func (o DNSRecordOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (DNSRecordOptions) MarshalJSON added in v1.11.10

func (o DNSRecordOptions) MarshalJSON() ([]byte, error)

func (DNSRecordOptions) Match added in v1.14.0

func (o DNSRecordOptions) Match(record dns.RR) bool

func (*DNSRecordOptions) UnmarshalJSON added in v1.11.10

func (o *DNSRecordOptions) UnmarshalJSON(data []byte) error

type DNSRouteActionOptions added in v1.11.0

type DNSRouteActionOptions struct {
	Server      string `json:"server,omitempty" reference:"dns_server"`
	Speculative bool   `json:"speculative,omitempty"`
	AbstractDNSRouteActionOptions
}

type DNSRouteActionPredefined added in v1.11.10

type DNSRouteActionPredefined struct {
	Rcode  *DNSRCode                            `json:"rcode,omitempty"`
	Answer badoption.Listable[DNSRecordOptions] `json:"answer,omitempty"`
	Ns     badoption.Listable[DNSRecordOptions] `json:"ns,omitempty"`
	Extra  badoption.Listable[DNSRecordOptions] `json:"extra,omitempty"`
}

type DNSRouteOptionsActionOptions added in v1.11.0

type DNSRouteOptionsActionOptions AbstractDNSRouteActionOptions

func (*DNSRouteOptionsActionOptions) UnmarshalJSON added in v1.11.0

func (r *DNSRouteOptionsActionOptions) UnmarshalJSON(data []byte) error

type DNSRule

type DNSRule _DNSRule

func (DNSRule) DescribeSchema added in v1.14.0

func (r DNSRule) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (DNSRule) IsValid added in v1.8.0

func (r DNSRule) IsValid() bool

func (DNSRule) MarshalJSON

func (r DNSRule) MarshalJSON() ([]byte, error)

func (*DNSRule) UnmarshalJSONContext added in v1.11.0

func (r *DNSRule) UnmarshalJSONContext(ctx context.Context, bytes []byte) error

type DNSRuleAction added in v1.11.0

type DNSRuleAction _DNSRuleAction

func (DNSRuleAction) MarshalJSON added in v1.11.0

func (r DNSRuleAction) MarshalJSON() ([]byte, error)

func (*DNSRuleAction) UnmarshalJSONContext added in v1.11.0

func (r *DNSRuleAction) UnmarshalJSONContext(ctx context.Context, data []byte) error

type DNSRuleMatchResponse added in v1.14.0

type DNSRuleMatchResponse struct {
	Enabled bool
	Tag     string
}

func (DNSRuleMatchResponse) DescribeSchema added in v1.14.0

func (m DNSRuleMatchResponse) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*DNSRuleMatchResponse) IsEnabled added in v1.14.0

func (m *DNSRuleMatchResponse) IsEnabled() bool

func (DNSRuleMatchResponse) MarshalJSON added in v1.14.0

func (m DNSRuleMatchResponse) MarshalJSON() ([]byte, error)

func (*DNSRuleMatchResponse) ResponseTag added in v1.14.0

func (m *DNSRuleMatchResponse) ResponseTag() string

func (*DNSRuleMatchResponse) UnmarshalJSON added in v1.14.0

func (m *DNSRuleMatchResponse) UnmarshalJSON(content []byte) error

type DNSServerAddressOptions added in v1.11.10

type DNSServerAddressOptions struct {
	Server     string `json:"server"`
	ServerPort uint16 `json:"server_port,omitempty"`
}

func (DNSServerAddressOptions) Build added in v1.11.10

func (*DNSServerAddressOptions) ReplaceServerOptions added in v1.11.10

func (o *DNSServerAddressOptions) ReplaceServerOptions(options ServerOptions)

func (DNSServerAddressOptions) ServerIsDomain added in v1.11.10

func (o DNSServerAddressOptions) ServerIsDomain() bool

func (*DNSServerAddressOptions) TakeServerOptions added in v1.11.10

func (o *DNSServerAddressOptions) TakeServerOptions() ServerOptions

type DNSServerOptions

type DNSServerOptions _DNSServerOptions

func (DNSServerOptions) DescribeSchema added in v1.14.0

func (o DNSServerOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*DNSServerOptions) MarshalJSONContext added in v1.11.10

func (o *DNSServerOptions) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*DNSServerOptions) UnmarshalJSONContext added in v1.11.10

func (o *DNSServerOptions) UnmarshalJSONContext(ctx context.Context, content []byte) error

type DNSTransportOptionsRegistry added in v1.11.10

type DNSTransportOptionsRegistry interface {
	OptionTypes() []string
	CreateOptions(transportType string) (any, bool)
}

type DebugOptions added in v1.2.0

type DebugOptions struct {
	Listen       string                   `json:"listen,omitempty"`
	GCPercent    *int                     `json:"gc_percent,omitempty"`
	MaxStack     *int                     `json:"max_stack,omitempty"`
	MaxThreads   *int                     `json:"max_threads,omitempty"`
	PanicOnFault *bool                    `json:"panic_on_fault,omitempty"`
	TraceBack    string                   `json:"trace_back,omitempty"`
	MemoryLimit  *byteformats.MemoryBytes `json:"memory_limit,omitempty"`
	OOMKiller    *bool                    `json:"oom_killer,omitempty"`
}

type DefaultDNSRule

type DefaultDNSRule struct {
	RawDefaultDNSRule
	DNSRuleAction
}

func (DefaultDNSRule) IsValid

func (r DefaultDNSRule) IsValid() bool

func (DefaultDNSRule) MarshalJSON added in v1.11.0

func (r DefaultDNSRule) MarshalJSON() ([]byte, error)

func (*DefaultDNSRule) UnmarshalJSONContext added in v1.11.0

func (r *DefaultDNSRule) UnmarshalJSONContext(ctx context.Context, data []byte) error

type DefaultHeadlessRule added in v1.8.0

type DefaultHeadlessRule struct {
	QueryType               badoption.Listable[DNSQueryType]                                            `json:"query_type,omitempty"`
	Network                 badoption.Listable[string]                                                  `json:"network,omitempty" enum:"tcp,udp,icmp"`
	Domain                  badoption.Listable[string]                                                  `json:"domain,omitempty"`
	DomainSuffix            badoption.Listable[string]                                                  `json:"domain_suffix,omitempty"`
	DomainKeyword           badoption.Listable[string]                                                  `json:"domain_keyword,omitempty"`
	DomainRegex             badoption.Listable[string]                                                  `json:"domain_regex,omitempty"`
	SourceIPCIDR            badoption.Listable[string]                                                  `json:"source_ip_cidr,omitempty"`
	IPCIDR                  badoption.Listable[string]                                                  `json:"ip_cidr,omitempty"`
	SourcePort              badoption.Listable[uint16]                                                  `json:"source_port,omitempty"`
	SourcePortRange         badoption.Listable[string]                                                  `json:"source_port_range,omitempty"`
	Port                    badoption.Listable[uint16]                                                  `json:"port,omitempty"`
	PortRange               badoption.Listable[string]                                                  `json:"port_range,omitempty"`
	ProcessName             badoption.Listable[string]                                                  `json:"process_name,omitempty"`
	ProcessPath             badoption.Listable[string]                                                  `json:"process_path,omitempty"`
	ProcessPathRegex        badoption.Listable[string]                                                  `json:"process_path_regex,omitempty"`
	PackageName             badoption.Listable[string]                                                  `json:"package_name,omitempty"`
	PackageNameRegex        badoption.Listable[string]                                                  `json:"package_name_regex,omitempty"`
	NetworkType             badoption.Listable[InterfaceType]                                           `json:"network_type,omitempty"`
	NetworkIsExpensive      bool                                                                        `json:"network_is_expensive,omitempty"`
	NetworkIsConstrained    bool                                                                        `json:"network_is_constrained,omitempty"`
	WIFISSID                badoption.Listable[string]                                                  `json:"wifi_ssid,omitempty"`
	WIFIBSSID               badoption.Listable[string]                                                  `json:"wifi_bssid,omitempty"`
	NetworkInterfaceAddress *badjson.TypedMap[InterfaceType, badoption.Listable[*badoption.Prefixable]] `json:"network_interface_address,omitempty"`
	DefaultInterfaceAddress badoption.Listable[*badoption.Prefixable]                                   `json:"default_interface_address,omitempty"`

	Invert bool `json:"invert,omitempty"`

	DomainMatcher *domain.Matcher `json:"-"`
	SourceIPSet   *netipx.IPSet   `json:"-"`
	IPSet         *netipx.IPSet   `json:"-"`

	AdGuardDomain        badoption.Listable[string] `json:"-"`
	AdGuardDomainMatcher *domain.AdGuardMatcher     `json:"-"`
}

func (DefaultHeadlessRule) IsValid added in v1.8.0

func (r DefaultHeadlessRule) IsValid() bool

type DefaultNetworkNamespaceOptions added in v1.14.0

type DefaultNetworkNamespaceOptions struct {
	Path string `json:"path"`
}

type DefaultRule

type DefaultRule struct {
	RawDefaultRule
	RuleAction
}

func (DefaultRule) IsValid

func (r DefaultRule) IsValid() bool

func (DefaultRule) MarshalJSON added in v1.11.0

func (r DefaultRule) MarshalJSON() ([]byte, error)

func (*DefaultRule) UnmarshalJSON added in v1.10.0

func (r *DefaultRule) UnmarshalJSON(data []byte) error

type DialerOptions

type DialerOptions struct {
	Detour string `json:"detour,omitempty" reference:"outbound"`
	AbstractDialerOptions
}

func (*DialerOptions) ReplaceDialerOptions added in v1.8.0

func (o *DialerOptions) ReplaceDialerOptions(options DialerOptions)

func (*DialerOptions) TakeDialerOptions added in v1.8.0

func (o *DialerOptions) TakeDialerOptions() DialerOptions

type DialerOptionsWrapper added in v1.8.0

type DialerOptionsWrapper interface {
	TakeDialerOptions() DialerOptions
	ReplaceDialerOptions(options DialerOptions)
}

type DirectActionOptions added in v1.11.0

type DirectActionOptions struct {
	AbstractDialerOptions
}

func (DirectActionOptions) Descriptions added in v1.11.0

func (d DirectActionOptions) Descriptions() []string

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 _DirectOutboundOptions

func (*DirectOutboundOptions) UnmarshalJSONContext added in v1.11.0

func (d *DirectOutboundOptions) UnmarshalJSONContext(ctx context.Context, content []byte) error

type DomainResolveOptions added in v1.11.10

type DomainResolveOptions _DomainResolveOptions

func (DomainResolveOptions) DescribeSchema added in v1.14.0

func (o DomainResolveOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (DomainResolveOptions) MarshalJSON added in v1.11.10

func (o DomainResolveOptions) MarshalJSON() ([]byte, error)

func (*DomainResolveOptions) UnmarshalJSON added in v1.11.10

func (o *DomainResolveOptions) UnmarshalJSON(bytes []byte) error

type DomainStrategy

type DomainStrategy C.DomainStrategy

func (DomainStrategy) DescribeSchema added in v1.14.0

func (s DomainStrategy) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (DomainStrategy) MarshalJSON

func (s DomainStrategy) MarshalJSON() ([]byte, error)

func (DomainStrategy) String added in v1.11.0

func (s DomainStrategy) String() string

func (*DomainStrategy) UnmarshalJSON

func (s *DomainStrategy) UnmarshalJSON(bytes []byte) error

type Endpoint added in v1.11.0

type Endpoint _Endpoint

func (Endpoint) DescribeSchema added in v1.14.0

func (h Endpoint) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*Endpoint) MarshalJSONContext added in v1.11.0

func (h *Endpoint) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*Endpoint) UnmarshalJSONContext added in v1.11.0

func (h *Endpoint) UnmarshalJSONContext(ctx context.Context, content []byte) error

type EndpointOptionsRegistry added in v1.11.0

type EndpointOptionsRegistry interface {
	OptionTypes() []string
	CreateOptions(endpointType string) (any, bool)
}

type ExperimentalOptions

type ExperimentalOptions struct {
	CacheFile *CacheFileOptions `json:"cache_file,omitempty"`
	ClashAPI  *ClashAPIOptions  `json:"clash_api,omitempty"`
	V2RayAPI  *V2RayAPIOptions  `json:"v2ray_api,omitempty"`
	Debug     *DebugOptions     `json:"debug,omitempty"`
}

type FakeIPDNSServerOptions added in v1.11.10

type FakeIPDNSServerOptions struct {
	Inet4Range *badoption.Prefix `json:"inet4_range,omitempty" examples:"198.18.0.0/15"`
	Inet6Range *badoption.Prefix `json:"inet6_range,omitempty" examples:"fc00::/18"`
}

type FwMark added in v1.10.0

type FwMark uint32

func (FwMark) DescribeSchema added in v1.14.0

func (f FwMark) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (FwMark) MarshalJSON added in v1.10.0

func (f FwMark) MarshalJSON() ([]byte, error)

func (*FwMark) UnmarshalJSON added in v1.10.0

func (f *FwMark) UnmarshalJSON(bytes []byte) error

type GeoIPOptions

type GeoIPOptions struct {
	Path           string `json:"path,omitempty"`
	DownloadURL    string `json:"download_url,omitempty"`
	DownloadDetour string `json:"download_detour,omitempty" reference:"outbound"`
}

type GeositeOptions

type GeositeOptions struct {
	Path           string `json:"path,omitempty"`
	DownloadURL    string `json:"download_url,omitempty"`
	DownloadDetour string `json:"download_detour,omitempty" reference:"outbound"`
}

type HTTP2Options added in v1.14.0

type HTTP2Options struct {
	IdleTimeout             badoption.Duration       `json:"idle_timeout,omitempty"`
	KeepAlivePeriod         badoption.Duration       `json:"keep_alive_period,omitempty"`
	StreamReceiveWindow     *byteformats.MemoryBytes `json:"stream_receive_window,omitempty"`
	ConnectionReceiveWindow *byteformats.MemoryBytes `json:"connection_receive_window,omitempty"`
	MaxConcurrentStreams    int                      `json:"max_concurrent_streams,omitempty"`
}

type HTTPClient added in v1.14.0

type HTTPClient _HTTPClientOptions

func (HTTPClient) DescribeSchema added in v1.14.0

func (h HTTPClient) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (HTTPClient) MarshalJSON added in v1.14.0

func (h HTTPClient) MarshalJSON() ([]byte, error)

func (HTTPClient) Options added in v1.14.0

func (h HTTPClient) Options() HTTPClientOptions

func (*HTTPClient) UnmarshalJSON added in v1.14.0

func (h *HTTPClient) UnmarshalJSON(content []byte) error

type HTTPClientOptions added in v1.14.0

type HTTPClientOptions _HTTPClientOptions

func (HTTPClientOptions) DescribeSchema added in v1.14.0

func (o HTTPClientOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (HTTPClientOptions) IsEmpty added in v1.14.0

func (o HTTPClientOptions) IsEmpty() bool

func (HTTPClientOptions) MarshalJSON added in v1.14.0

func (o HTTPClientOptions) MarshalJSON() ([]byte, error)

func (*HTTPClientOptions) UnmarshalJSON added in v1.14.0

func (o *HTTPClientOptions) UnmarshalJSON(content []byte) error

type HTTPMixedInboundOptions

type HTTPMixedInboundOptions struct {
	ListenOptions
	Users          []auth.User           `json:"users,omitempty"`
	DomainResolver *DomainResolveOptions `json:"domain_resolver,omitempty"`
	SetSystemProxy bool                  `json:"set_system_proxy,omitempty"`
	InboundTLSOptionsContainer
}

type HTTPOutboundOptions

type HTTPOutboundOptions struct {
	DialerOptions
	ServerOptions
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	OutboundTLSOptionsContainer
	Path    string               `json:"path,omitempty"`
	Headers badoption.HTTPHeader `json:"headers,omitempty"`
}

type HTTPProxyOptions added in v1.2.0

type HTTPProxyOptions struct {
	Enabled bool `json:"enabled,omitempty"`
	ServerOptions
	BypassDomain badoption.Listable[string] `json:"bypass_domain,omitempty"`
	MatchDomain  badoption.Listable[string] `json:"match_domain,omitempty"`
}

type HeadlessRule added in v1.8.0

type HeadlessRule _HeadlessRule

func (HeadlessRule) DescribeSchema added in v1.14.0

func (r HeadlessRule) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (HeadlessRule) IsValid added in v1.8.0

func (r HeadlessRule) IsValid() bool

func (HeadlessRule) MarshalJSON added in v1.8.0

func (r HeadlessRule) MarshalJSON() ([]byte, error)

func (*HeadlessRule) UnmarshalJSON added in v1.8.0

func (r *HeadlessRule) UnmarshalJSON(bytes []byte) error

type HostsDNSServerOptions added in v1.11.10

type HostsDNSServerOptions struct {
	Path       badoption.Listable[string]                                `json:"path,omitempty"`
	Predefined *badjson.TypedMap[string, badoption.Listable[netip.Addr]] `json:"predefined,omitempty"`
}

type Hysteria2InboundOptions added in v1.4.3

type Hysteria2InboundOptions struct {
	ListenOptions
	UpMbps                int             `json:"up_mbps,omitempty"`
	DownMbps              int             `json:"down_mbps,omitempty"`
	Obfs                  *Hysteria2Obfs  `json:"obfs,omitempty"`
	Users                 []Hysteria2User `json:"users,omitempty"`
	IgnoreClientBandwidth bool            `json:"ignore_client_bandwidth,omitempty"`
	InboundTLSOptionsContainer
	QUICOptions
	Masquerade  *Hysteria2Masquerade   `json:"masquerade,omitempty"`
	BBRProfile  string                 `json:"bbr_profile,omitempty" enum:"standard,conservative,aggressive"`
	BrutalDebug bool                   `json:"brutal_debug,omitempty"`
	Realm       *Hysteria2InboundRealm `json:"realm,omitempty"`
}

type Hysteria2InboundRealm added in v1.14.0

type Hysteria2InboundRealm struct {
	Hysteria2Realm
	STUNDomainResolver *DomainResolveOptions `json:"stun_domain_resolver,omitempty"`
}

type Hysteria2Masquerade added in v1.11.0

type Hysteria2Masquerade _Hysteria2Masquerade

func (Hysteria2Masquerade) DescribeSchema added in v1.14.0

func (m Hysteria2Masquerade) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (Hysteria2Masquerade) MarshalJSON added in v1.11.0

func (m Hysteria2Masquerade) MarshalJSON() ([]byte, error)

func (*Hysteria2Masquerade) UnmarshalJSON added in v1.11.0

func (m *Hysteria2Masquerade) UnmarshalJSON(bytes []byte) error

type Hysteria2MasqueradeFile added in v1.11.0

type Hysteria2MasqueradeFile struct {
	Directory string `json:"directory"`
}

type Hysteria2MasqueradeProxy added in v1.11.0

type Hysteria2MasqueradeProxy struct {
	URL         string `json:"url"`
	RewriteHost bool   `json:"rewrite_host,omitempty"`
}

type Hysteria2MasqueradeString added in v1.11.0

type Hysteria2MasqueradeString struct {
	StatusCode int                  `json:"status_code,omitempty"`
	Headers    badoption.HTTPHeader `json:"headers,omitempty"`
	Content    string               `json:"content"`
}

type Hysteria2Obfs added in v1.4.3

type Hysteria2Obfs _Hysteria2Obfs

func (Hysteria2Obfs) DescribeSchema added in v1.14.0

func (o Hysteria2Obfs) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (Hysteria2Obfs) MarshalJSON added in v1.14.0

func (o Hysteria2Obfs) MarshalJSON() ([]byte, error)

func (*Hysteria2Obfs) UnmarshalJSON added in v1.14.0

func (o *Hysteria2Obfs) UnmarshalJSON(bytes []byte) error

type Hysteria2ObfsGecko added in v1.14.0

type Hysteria2ObfsGecko struct {
	MinPacketSize int `json:"min_packet_size,omitempty"`
	MaxPacketSize int `json:"max_packet_size,omitempty"`
}

type Hysteria2OutboundOptions added in v1.4.3

type Hysteria2OutboundOptions struct {
	DialerOptions
	ServerOptions
	ServerPorts    badoption.Listable[string] `json:"server_ports,omitempty"`
	HopInterval    badoption.Duration         `json:"hop_interval,omitempty"`
	HopIntervalMax badoption.Duration         `json:"hop_interval_max,omitempty"`
	UpMbps         int                        `json:"up_mbps,omitempty"`
	DownMbps       int                        `json:"down_mbps,omitempty"`
	Obfs           *Hysteria2Obfs             `json:"obfs,omitempty"`
	Password       string                     `json:"password,omitempty"`
	Network        NetworkList                `json:"network,omitempty"`
	OutboundTLSOptionsContainer
	QUICOptions
	BBRProfile          string          `json:"bbr_profile,omitempty" enum:"standard,conservative,aggressive"`
	BrutalDebug         bool            `json:"brutal_debug,omitempty"`
	DisableChromeParrot bool            `json:"disable_chrome_parrot,omitempty"`
	Realm               *Hysteria2Realm `json:"realm,omitempty"`
}

type Hysteria2Realm added in v1.14.0

type Hysteria2Realm struct {
	ServerURL   string                     `json:"server_url"`
	Token       string                     `json:"token,omitempty"`
	RealmID     string                     `json:"realm_id"`
	STUNServers badoption.Listable[string] `json:"stun_servers"`
	IPVersion   int                        `json:"ip_version,omitempty" enum:"0,4,6"`
	PortMapping *Hysteria2RealmPortMapping `json:"port_mapping,omitempty"`
	HTTPClient  *HTTPClientOptions         `json:"http_client,omitempty"`
}

func (Hysteria2Realm) STUNServersIsDomain added in v1.14.2

func (r Hysteria2Realm) STUNServersIsDomain() bool

type Hysteria2RealmPortMapping added in v1.14.0

type Hysteria2RealmPortMapping struct {
	Enabled  bool               `json:"enabled,omitempty"`
	Timeout  badoption.Duration `json:"timeout,omitempty"`
	Lifetime badoption.Duration `json:"lifetime,omitempty"`
}

type Hysteria2User added in v1.4.3

type Hysteria2User struct {
	Name     string `json:"name,omitempty"`
	Password string `json:"password,omitempty"`
}

type HysteriaInboundOptions added in v1.0.1

type HysteriaInboundOptions struct {
	ListenOptions
	Up       *byteformats.NetworkBytesCompat `json:"up,omitempty"`
	UpMbps   int                             `json:"up_mbps,omitempty"`
	Down     *byteformats.NetworkBytesCompat `json:"down,omitempty"`
	DownMbps int                             `json:"down_mbps,omitempty"`
	Obfs     string                          `json:"obfs,omitempty"`
	Users    []HysteriaUser                  `json:"users,omitempty"`
	// Deprecated: use QUIC fields instead
	ReceiveWindowConn uint64 `json:"recv_window_conn,omitempty" schema:"omit"`
	// Deprecated: use QUIC fields instead
	ReceiveWindowClient uint64 `json:"recv_window_client,omitempty" schema:"omit"`
	// Deprecated: use QUIC fields instead
	MaxConnClient int `json:"max_conn_client,omitempty" schema:"omit"`
	// Deprecated: use QUIC fields instead
	DisableMTUDiscovery bool `json:"disable_mtu_discovery,omitempty" schema:"omit"`
	InboundTLSOptionsContainer
	QUICOptions
}

type HysteriaOutboundOptions added in v1.0.1

type HysteriaOutboundOptions struct {
	DialerOptions
	ServerOptions
	ServerPorts badoption.Listable[string]      `json:"server_ports,omitempty"`
	HopInterval badoption.Duration              `json:"hop_interval,omitempty"`
	Up          *byteformats.NetworkBytesCompat `json:"up,omitempty"`
	UpMbps      int                             `json:"up_mbps,omitempty"`
	Down        *byteformats.NetworkBytesCompat `json:"down,omitempty"`
	DownMbps    int                             `json:"down_mbps,omitempty"`
	Obfs        string                          `json:"obfs,omitempty"`
	Auth        []byte                          `json:"auth,omitempty"`
	AuthString  string                          `json:"auth_str,omitempty"`
	// Deprecated: use QUIC fields instead
	ReceiveWindowConn uint64 `json:"recv_window_conn,omitempty" schema:"omit"`
	// Deprecated: use QUIC fields instead
	ReceiveWindow uint64 `json:"recv_window,omitempty" schema:"omit"`
	// Deprecated: use QUIC fields instead
	DisableMTUDiscovery bool        `json:"disable_mtu_discovery,omitempty" schema:"omit"`
	Network             NetworkList `json:"network,omitempty"`
	OutboundTLSOptionsContainer
	QUICOptions
}

type HysteriaRealmServiceOptions added in v1.14.0

type HysteriaRealmServiceOptions struct {
	ListenOptions
	InboundTLSOptionsContainer
	HTTP2Options
	Users []HysteriaRealmUser `json:"users"`
}

type HysteriaRealmUser added in v1.14.0

type HysteriaRealmUser struct {
	Name      string `json:"name"`
	Token     string `json:"token"`
	MaxRealms int    `json:"max_realms,omitempty"`
}

type HysteriaUser added in v1.1.0

type HysteriaUser struct {
	Name       string `json:"name,omitempty"`
	Auth       []byte `json:"auth,omitempty"`
	AuthString string `json:"auth_str,omitempty"`
}

type Inbound

type Inbound _Inbound

func (Inbound) DescribeSchema added in v1.14.0

func (h Inbound) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*Inbound) MarshalJSONContext added in v1.11.0

func (h *Inbound) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*Inbound) UnmarshalJSONContext added in v1.11.0

func (h *Inbound) UnmarshalJSONContext(ctx context.Context, content []byte) error

type InboundACMEOptions added in v1.0.1

type InboundACMEOptions struct {
	Domain                  badoption.Listable[string]  `json:"domain,omitempty"`
	DataDirectory           string                      `json:"data_directory,omitempty"`
	DefaultServerName       string                      `json:"default_server_name,omitempty"`
	Email                   string                      `json:"email,omitempty"`
	Provider                string                      `json:"provider,omitempty"`
	DisableHTTPChallenge    bool                        `json:"disable_http_challenge,omitempty"`
	DisableTLSALPNChallenge bool                        `json:"disable_tls_alpn_challenge,omitempty"`
	AlternativeHTTPPort     uint16                      `json:"alternative_http_port,omitempty"`
	AlternativeTLSPort      uint16                      `json:"alternative_tls_port,omitempty"`
	ExternalAccount         *ACMEExternalAccountOptions `json:"external_account,omitempty"`
	DNS01Challenge          *ACMEDNS01ChallengeOptions  `json:"dns01_challenge,omitempty"`
	Profile                 string                      `json:"profile,omitempty"`
}

type InboundECHOptions added in v1.4.3

type InboundECHOptions struct {
	Enabled bool                       `json:"enabled,omitempty"`
	Key     badoption.Listable[string] `json:"key,omitempty"`
	KeyPath string                     `json:"key_path,omitempty"`

	// Deprecated: not supported by stdlib
	PQSignatureSchemesEnabled bool `json:"pq_signature_schemes_enabled,omitempty" schema:"omit"`
	// Deprecated: added by fault
	DynamicRecordSizingDisabled bool `json:"dynamic_record_sizing_disabled,omitempty" schema:"omit"`
}

type InboundMultiplexOptions added in v1.7.0

type InboundMultiplexOptions struct {
	Enabled bool           `json:"enabled,omitempty"`
	Padding bool           `json:"padding,omitempty"`
	Brutal  *BrutalOptions `json:"brutal,omitempty"`
}

type InboundOptions deprecated

type InboundOptions struct {
	SniffEnabled              bool               `json:"sniff,omitempty" schema:"omit"`
	SniffOverrideDestination  bool               `json:"sniff_override_destination,omitempty" schema:"omit"`
	SniffTimeout              badoption.Duration `json:"sniff_timeout,omitempty" schema:"omit"`
	DomainStrategy            DomainStrategy     `json:"domain_strategy,omitempty" schema:"omit"`
	UDPDisableDomainUnmapping bool               `json:"udp_disable_domain_unmapping,omitempty" schema:"omit"`
}

Deprecated: Use rule action instead

type InboundOptionsRegistry added in v1.11.0

type InboundOptionsRegistry interface {
	OptionTypes() []string
	CreateOptions(outboundType string) (any, bool)
}

type InboundRealityHandshakeOptions added in v1.2.0

type InboundRealityHandshakeOptions struct {
	ServerOptions
	DialerOptions
}

type InboundRealityOptions added in v1.2.0

type InboundRealityOptions struct {
	Enabled           bool                           `json:"enabled,omitempty"`
	Handshake         InboundRealityHandshakeOptions `json:"handshake,omitempty"`
	PrivateKey        string                         `json:"private_key,omitempty"`
	ShortID           badoption.Listable[string]     `json:"short_id,omitempty"`
	MaxTimeDifference badoption.Duration             `json:"max_time_difference,omitempty"`
}

type InboundTLSOptions

type InboundTLSOptions struct {
	Enabled                          bool                                `json:"enabled,omitempty"`
	ServerName                       string                              `json:"server_name,omitempty"`
	Insecure                         bool                                `json:"insecure,omitempty"`
	ALPN                             badoption.Listable[string]          `json:"alpn,omitempty" examples:"http/1.1,h2,h3"`
	MinVersion                       string                              `json:"min_version,omitempty" enum:"1.0,1.1,1.2,1.3"`
	MaxVersion                       string                              `json:"max_version,omitempty" enum:"1.0,1.1,1.2,1.3"`
	CipherSuites                     badoption.Listable[string]          `json:"cipher_suites,omitempty"`
	CurvePreferences                 badoption.Listable[CurvePreference] `json:"curve_preferences,omitempty"`
	Certificate                      badoption.Listable[string]          `json:"certificate,omitempty"`
	CertificatePath                  string                              `json:"certificate_path,omitempty"`
	ClientAuthentication             ClientAuthType                      `json:"client_authentication,omitempty"`
	ClientCertificate                badoption.Listable[string]          `json:"client_certificate,omitempty"`
	ClientCertificatePath            badoption.Listable[string]          `json:"client_certificate_path,omitempty"`
	ClientCertificatePublicKeySHA256 badoption.Listable[[]byte]          `json:"client_certificate_public_key_sha256,omitempty"`
	Key                              badoption.Listable[string]          `json:"key,omitempty"`
	KeyPath                          string                              `json:"key_path,omitempty"`
	KernelTx                         bool                                `json:"kernel_tx,omitempty"`
	KernelRx                         bool                                `json:"kernel_rx,omitempty"`
	HandshakeTimeout                 badoption.Duration                  `json:"handshake_timeout,omitempty"`
	CertificateProvider              *CertificateProviderOptions         `json:"certificate_provider,omitempty"`

	// Deprecated: use certificate_provider
	ACME *InboundACMEOptions `json:"acme,omitempty" schema:"omit"`

	ECH     *InboundECHOptions     `json:"ech,omitempty"`
	Reality *InboundRealityOptions `json:"reality,omitempty"`
}

type InboundTLSOptionsContainer added in v1.8.0

type InboundTLSOptionsContainer struct {
	TLS *InboundTLSOptions `json:"tls,omitempty"`
}

func (*InboundTLSOptionsContainer) ReplaceInboundTLSOptions added in v1.8.0

func (o *InboundTLSOptionsContainer) ReplaceInboundTLSOptions(options *InboundTLSOptions)

func (*InboundTLSOptionsContainer) TakeInboundTLSOptions added in v1.8.0

func (o *InboundTLSOptionsContainer) TakeInboundTLSOptions() *InboundTLSOptions

type InboundTLSOptionsWrapper added in v1.8.0

type InboundTLSOptionsWrapper interface {
	TakeInboundTLSOptions() *InboundTLSOptions
	ReplaceInboundTLSOptions(options *InboundTLSOptions)
}

type InterfaceType added in v1.11.0

type InterfaceType C.InterfaceType

func (InterfaceType) Build added in v1.11.0

func (t InterfaceType) Build() C.InterfaceType

func (InterfaceType) DescribeSchema added in v1.14.0

func (t InterfaceType) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (InterfaceType) MarshalJSON added in v1.11.0

func (t InterfaceType) MarshalJSON() ([]byte, error)

func (*InterfaceType) UnmarshalJSON added in v1.11.0

func (t *InterfaceType) UnmarshalJSON(content []byte) error

type ListenOptions

type ListenOptions struct {
	Listen               *badoption.Addr    `json:"listen,omitempty"`
	ListenPort           uint16             `json:"listen_port,omitempty"`
	BindInterface        string             `json:"bind_interface,omitempty"`
	RoutingMark          FwMark             `json:"routing_mark,omitempty"`
	ReuseAddr            bool               `json:"reuse_addr,omitempty"`
	NetNs                string             `json:"netns,omitempty" reference:"network_namespace"`
	DisableTCPKeepAlive  bool               `json:"disable_tcp_keep_alive,omitempty"`
	TCPKeepAlive         badoption.Duration `json:"tcp_keep_alive,omitempty"`
	TCPKeepAliveInterval badoption.Duration `json:"tcp_keep_alive_interval,omitempty"`
	TCPFastOpen          bool               `json:"tcp_fast_open,omitempty"`
	TCPMultiPath         bool               `json:"tcp_multi_path,omitempty"`
	UDPFragment          *bool              `json:"udp_fragment,omitempty"`
	UDPFragmentDefault   bool               `json:"-"`
	UDPTimeout           UDPTimeoutCompat   `json:"udp_timeout,omitempty"`
	Detour               string             `json:"detour,omitempty" reference:"inbound"`

	// Deprecated: removed
	ProxyProtocol bool `json:"proxy_protocol,omitempty" schema:"omit"`
	// Deprecated: removed
	ProxyProtocolAcceptNoHeader bool `json:"proxy_protocol_accept_no_header,omitempty" schema:"omit"`
	// Legacy inbound fields are rejected since sing-box 1.13.0.
	//nolint:staticcheck
	InboundOptions `schema:"omit"`
}

func (*ListenOptions) ReplaceListenOptions added in v1.8.0

func (o *ListenOptions) ReplaceListenOptions(options ListenOptions)

func (*ListenOptions) TakeListenOptions added in v1.8.0

func (o *ListenOptions) TakeListenOptions() ListenOptions

type ListenOptionsWrapper added in v1.8.0

type ListenOptionsWrapper interface {
	TakeListenOptions() ListenOptions
	ReplaceListenOptions(options ListenOptions)
}

type LocalDNSServerOptions added in v1.11.10

type LocalDNSServerOptions struct {
	RawLocalDNSServerOptions
	PreferGo       bool                       `json:"prefer_go,omitempty"`
	NeighborDomain badoption.Listable[string] `json:"neighbor_domain,omitempty"`
}

type LocalRuleSet added in v1.8.0

type LocalRuleSet struct {
	Path string `json:"path,omitempty"`
}

type LogOptions

type LogOptions struct {
	Disabled     bool   `json:"disabled,omitempty"`
	Level        string `json:"level,omitempty" enum:"trace,debug,info,warn,warning,error,fatal,panic"`
	Output       string `json:"output,omitempty"`
	Timestamp    bool   `json:"timestamp,omitempty"`
	DisableColor bool   `json:"-"`
}

type LogicalDNSRule

type LogicalDNSRule struct {
	RawLogicalDNSRule
	DNSRuleAction
}

func (*LogicalDNSRule) IsValid

func (r *LogicalDNSRule) IsValid() bool

func (LogicalDNSRule) MarshalJSON added in v1.11.0

func (r LogicalDNSRule) MarshalJSON() ([]byte, error)

func (*LogicalDNSRule) UnmarshalJSONContext added in v1.11.0

func (r *LogicalDNSRule) UnmarshalJSONContext(ctx context.Context, data []byte) error

type LogicalHeadlessRule added in v1.8.0

type LogicalHeadlessRule struct {
	Mode   string         `json:"mode" enum:"and,or"`
	Rules  []HeadlessRule `json:"rules,omitempty"`
	Invert bool           `json:"invert,omitempty"`
}

func (LogicalHeadlessRule) IsValid added in v1.8.0

func (r LogicalHeadlessRule) IsValid() bool

type LogicalRule

type LogicalRule struct {
	RawLogicalRule
	RuleAction
}

func (*LogicalRule) IsValid

func (r *LogicalRule) IsValid() bool

func (LogicalRule) MarshalJSON added in v1.11.0

func (r LogicalRule) MarshalJSON() ([]byte, error)

func (*LogicalRule) UnmarshalJSON added in v1.11.0

func (r *LogicalRule) UnmarshalJSON(data []byte) error

type MDNSDNSServerOptions added in v1.14.0

type MDNSDNSServerOptions struct {
	LocalDNSServerOptions
	Interface badoption.Listable[string] `json:"interface,omitempty"`
}

type NTPOptions added in v1.2.0

type NTPOptions struct {
	Enabled       bool               `json:"enabled,omitempty"`
	Interval      badoption.Duration `json:"interval,omitempty"`
	WriteToSystem bool               `json:"write_to_system,omitempty"`
	ServerOptions
	DialerOptions
}

type NaiveInboundOptions

type NaiveInboundOptions struct {
	ListenOptions
	Users                 []auth.User `json:"users,omitempty"`
	Network               NetworkList `json:"network,omitempty"`
	QUICCongestionControl string      `json:"quic_congestion_control,omitempty" enum:"bbr,cubic,reno"`
	InboundTLSOptionsContainer
}

type NaiveOutboundOptions added in v1.13.0

type NaiveOutboundOptions struct {
	DialerOptions
	ServerOptions
	Username                 string                   `json:"username,omitempty"`
	Password                 string                   `json:"password,omitempty"`
	InsecureConcurrency      int                      `json:"insecure_concurrency,omitempty"`
	ExtraHeaders             badoption.HTTPHeader     `json:"extra_headers,omitempty"`
	ReceiveWindow            *byteformats.MemoryBytes `json:"stream_receive_window,omitempty"`
	UDPOverTCP               *UDPOverTCPOptions       `json:"udp_over_tcp,omitempty"`
	QUIC                     bool                     `json:"quic,omitempty"`
	QUICCongestionControl    string                   `json:"quic_congestion_control,omitempty" enum:"bbr,bbr2,cubic,reno"`
	QUICSessionReceiveWindow *byteformats.MemoryBytes `json:"quic_session_receive_window,omitempty"`
	OutboundTLSOptionsContainer
}

type NetworkList

type NetworkList string

func (NetworkList) Build

func (v NetworkList) Build() []string

func (NetworkList) DescribeSchema added in v1.14.0

func (v NetworkList) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*NetworkList) UnmarshalJSON

func (v *NetworkList) UnmarshalJSON(content []byte) error

type NetworkNamespace added in v1.14.0

type NetworkNamespace _NetworkNamespace

func (NetworkNamespace) DescribeSchema added in v1.14.0

func (o NetworkNamespace) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (NetworkNamespace) MarshalJSON added in v1.14.0

func (o NetworkNamespace) MarshalJSON() ([]byte, error)

func (*NetworkNamespace) UnmarshalJSON added in v1.14.0

func (o *NetworkNamespace) UnmarshalJSON(content []byte) error

type NetworkStrategy added in v1.11.0

type NetworkStrategy C.NetworkStrategy

func (NetworkStrategy) DescribeSchema added in v1.14.0

func (n NetworkStrategy) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (NetworkStrategy) MarshalJSON added in v1.11.0

func (n NetworkStrategy) MarshalJSON() ([]byte, error)

func (*NetworkStrategy) UnmarshalJSON added in v1.11.0

func (n *NetworkStrategy) UnmarshalJSON(content []byte) error

type OCMServiceOptions added in v1.13.0

type OCMServiceOptions struct {
	ListenOptions
	InboundTLSOptionsContainer
	CredentialPath string               `json:"credential_path,omitempty"`
	Users          []OCMUser            `json:"users,omitempty"`
	Headers        badoption.HTTPHeader `json:"headers,omitempty"`
	Detour         string               `json:"detour,omitempty" reference:"outbound"`
	UsagesPath     string               `json:"usages_path,omitempty"`
}

type OCMUser added in v1.13.0

type OCMUser struct {
	Name  string `json:"name,omitempty"`
	Token string `json:"token,omitempty"`
}

type OOMKillerServiceOptions added in v1.13.0

type OOMKillerServiceOptions struct {
	MemoryLimit         *byteformats.MemoryBytes `json:"memory_limit,omitempty"`
	SafetyMargin        *byteformats.MemoryBytes `json:"safety_margin,omitempty"`
	MinInterval         badoption.Duration       `json:"min_interval,omitempty"`
	MaxInterval         badoption.Duration       `json:"max_interval,omitempty"`
	KillerDisabled      bool                     `json:"-"`
	MemoryLimitOverride uint64                   `json:"-"`
}

type OpenConnectCSDOptions added in v1.14.0

type OpenConnectCSDOptions struct {
	WrapperPath string `json:"wrapper_path,omitempty"`
}

type OpenConnectDNSServerOptions added in v1.14.0

type OpenConnectDNSServerOptions struct {
	Endpoint               string `json:"endpoint,omitempty"`
	AcceptDefaultResolvers bool   `json:"accept_default_resolvers,omitempty"`
	AcceptSearchDomain     bool   `json:"accept_search_domain,omitempty"`
}

type OpenConnectEndpointOptions added in v1.14.0

type OpenConnectEndpointOptions struct {
	DialerOptions
	System                         bool                                 `json:"system,omitempty"`
	Name                           string                               `json:"name,omitempty"`
	UDPTimeout                     badoption.Duration                   `json:"udp_timeout,omitempty"`
	UDPMapping                     UDPNATBehavior                       `json:"udp_mapping,omitempty"`
	UDPFiltering                   UDPNATBehavior                       `json:"udp_filtering,omitempty"`
	UDPNATMax                      uint32                               `json:"udp_nat_max,omitempty"`
	Server                         string                               `json:"server"`
	Flavor                         string                               `json:"flavor,omitempty" enum:"anyconnect,gp,fortinet,f5,pulse,nc"`
	Username                       string                               `json:"username,omitempty"`
	Password                       string                               `json:"password,omitempty"`
	AuthGroup                      string                               `json:"auth_group,omitempty"`
	Cookie                         string                               `json:"cookie,omitempty"`
	Token                          *OpenConnectTokenOptions             `json:"token,omitempty"`
	ReportedOS                     string                               `json:"reported_os,omitempty"`
	UserAgent                      string                               `json:"user_agent,omitempty"`
	Version                        string                               `json:"version,omitempty"`
	LocalHostname                  string                               `json:"local_hostname,omitempty"`
	Mobile                         *OpenConnectMobileOptions            `json:"mobile,omitempty"`
	CSD                            *OpenConnectCSDOptions               `json:"csd,omitempty"`
	HIP                            *OpenConnectHIPOptions               `json:"hip,omitempty"`
	TNCC                           *OpenConnectTNCCOptions              `json:"tncc,omitempty"`
	FortinetHostCheck              *OpenConnectFortinetHostCheckOptions `json:"fortinet_host_check,omitempty"`
	NoUDP                          bool                                 `json:"no_udp,omitempty"`
	DTLSLocalPort                  uint16                               `json:"dtls_local_port,omitempty"`
	CompressionDisabled            bool                                 `json:"compression_disabled,omitempty"`
	CompressionMode                string                               `json:"compression_mode,omitempty" enum:"stateless,all"`
	IPv6Disabled                   bool                                 `json:"ipv6_disabled,omitempty"`
	HTTPKeepAliveDisabled          bool                                 `json:"http_keepalive_disabled,omitempty"`
	XMLPostDisabled                bool                                 `json:"xml_post_disabled,omitempty"`
	ExternalAuthDisabled           bool                                 `json:"external_auth_disabled,omitempty"`
	PasswordAuthenticationDisabled bool                                 `json:"password_authentication_disabled,omitempty"`
	TCPKeepAliveEnabled            bool                                 `json:"tcp_keep_alive_enabled,omitempty"`
	PFS                            bool                                 `json:"pfs,omitempty"`
	MTU                            uint32                               `json:"mtu,omitempty"`
	BaseMTU                        uint32                               `json:"base_mtu,omitempty"`
	DPDInterval                    badoption.Duration                   `json:"dpd_interval,omitempty"`
	ReconnectTimeout               badoption.Duration                   `json:"reconnect_timeout,omitempty"`
	TrojanInterval                 badoption.Duration                   `json:"trojan_interval,omitempty"`
	QueueLength                    uint32                               `json:"queue_length,omitempty"`
	AllowInsecureCrypto            bool                                 `json:"allow_insecure_crypto,omitempty"`
	TLS                            OpenConnectTLSOptions                `json:"tls,omitempty"`
	FormEntries                    []OpenConnectFormEntryOptions        `json:"form_entries,omitempty"`
}

type OpenConnectFormEntryOptions added in v1.14.0

type OpenConnectFormEntryOptions struct {
	FormID        string `json:"form_id,omitempty"`
	SubmissionKey string `json:"submission_key,omitempty"`
	Name          string `json:"name,omitempty"`
	Value         string `json:"value,omitempty"`
	Promote       bool   `json:"promote,omitempty"`
}

type OpenConnectFortinetHostCheckOptions added in v1.14.0

type OpenConnectFortinetHostCheckOptions struct {
	HostCheck           string `json:"hostcheck,omitempty"`
	CheckVirtualDesktop string `json:"check_virtual_desktop,omitempty"`
}

type OpenConnectHIPOptions added in v1.14.0

type OpenConnectHIPOptions struct {
	WrapperPath string `json:"wrapper_path,omitempty"`
}

type OpenConnectMobileOptions added in v1.14.0

type OpenConnectMobileOptions struct {
	PlatformVersion string `json:"platform_version"`
	DeviceType      string `json:"device_type"`
	DeviceUniqueID  string `json:"device_unique_id"`
}

type OpenConnectTLSOptions added in v1.14.0

type OpenConnectTLSOptions struct {
	Insecure                 bool                       `json:"insecure,omitempty"`
	ServerName               string                     `json:"server_name,omitempty"`
	PeerFingerprint          badoption.Listable[string] `json:"peer_fingerprint,omitempty"`
	SystemTrustDisabled      bool                       `json:"system_trust_disabled,omitempty"`
	CertificateAuthority     badoption.Listable[string] `json:"certificate_authority,omitempty"`
	CertificateAuthorityPath string                     `json:"certificate_authority_path,omitempty"`
	ClientCertificate        badoption.Listable[string] `json:"client_certificate,omitempty"`
	ClientCertificatePath    string                     `json:"client_certificate_path,omitempty"`
	ClientKey                badoption.Listable[string] `json:"client_key,omitempty"`
	ClientKeyPath            string                     `json:"client_key_path,omitempty"`
	ClientKeyPassword        string                     `json:"client_key_password,omitempty"`
	MCACertificate           badoption.Listable[string] `json:"mca_certificate,omitempty"`
	MCACertificatePath       string                     `json:"mca_certificate_path,omitempty"`
	MCAKey                   badoption.Listable[string] `json:"mca_key,omitempty"`
	MCAKeyPath               string                     `json:"mca_key_path,omitempty"`
	MCAKeyPassword           string                     `json:"mca_key_password,omitempty"`
}

type OpenConnectTNCCCertificateOptions added in v1.14.0

type OpenConnectTNCCCertificateOptions struct {
	Certificate     badoption.Listable[string] `json:"certificate,omitempty"`
	CertificatePath string                     `json:"certificate_path,omitempty"`
}

type OpenConnectTNCCOptions added in v1.14.0

type OpenConnectTNCCOptions struct {
	WrapperPath                  string                              `json:"wrapper_path,omitempty"`
	DeviceID                     string                              `json:"device_id,omitempty"`
	UserAgent                    string                              `json:"user_agent,omitempty"`
	MachineIdentificationEnabled bool                                `json:"machine_identification_enabled,omitempty"`
	Certificates                 []OpenConnectTNCCCertificateOptions `json:"certificates,omitempty"`
}

type OpenConnectTokenOptions added in v1.14.0

type OpenConnectTokenOptions struct {
	Mode       string `json:"mode,omitempty" enum:"totp,hotp,stoken,oidc"`
	Secret     string `json:"secret,omitempty"`
	SecretPath string `json:"secret_path,omitempty"`
	PIN        string `json:"pin,omitempty"`
	Password   string `json:"password,omitempty"`
	DeviceID   string `json:"device_id,omitempty"`
	Counter    uint64 `json:"counter,omitempty"`
}

type OpenVPNClientEndpointOptions added in v1.14.0

type OpenVPNClientEndpointOptions struct {
	DialerOptions
	ServerOptions
	OpenVPNEndpointOptions
	Mode                 string                           `json:"mode,omitempty" enum:"tls,static_key"`
	Network              string                           `json:"network,omitempty" enum:"udp,udp4,udp6,tcp,tcp4,tcp6"`
	Servers              []OpenVPNRemoteOptions           `json:"servers,omitempty"`
	RemoteRandom         bool                             `json:"remote_random,omitempty"`
	Address              badoption.Listable[netip.Prefix] `json:"address,omitempty"`
	PeerAddress          *badoption.Addr                  `json:"peer_address,omitempty"`
	PeerAddressIPv6      *badoption.Addr                  `json:"peer_address_ipv6,omitempty"`
	Topology             string                           `json:"topology,omitempty" enum:"net30,p2p,subnet"`
	Username             string                           `json:"username,omitempty"`
	Password             string                           `json:"password,omitempty"`
	AuthRetry            string                           `json:"auth_retry,omitempty" enum:"none,nointeract,interact"`
	StaticChallenge      string                           `json:"static_challenge,omitempty"`
	StaticChallengeEcho  bool                             `json:"static_challenge_echo,omitempty"`
	StaticKey            badoption.Listable[string]       `json:"static_key,omitempty"`
	StaticKeyPath        string                           `json:"static_key_path,omitempty"`
	KeyDirection         string                           `json:"key_direction,omitempty" enum:"server,client"`
	TLS                  *OpenVPNOutboundTLSOptions       `json:"tls,omitempty"`
	Cipher               string                           `json:"cipher,omitempty"`
	DataCiphers          badoption.Listable[string]       `json:"data_ciphers,omitempty"`
	DataCiphersFallback  string                           `json:"data_ciphers_fallback,omitempty"`
	Auth                 string                           `json:"auth,omitempty"`
	MSSFix               uint32                           `json:"mss_fix,omitempty"`
	MSSFixDisabled       bool                             `json:"mss_fix_disabled,omitempty"`
	MSSFixMode           string                           `json:"mss_fix_mode,omitempty" enum:"mtu,fixed"`
	Fragment             uint32                           `json:"fragment,omitempty"`
	ReplayWindow         uint32                           `json:"replay_window,omitempty"`
	ReplayWindowTime     badoption.Duration               `json:"replay_window_time,omitempty"`
	Compression          string                           `json:"compression,omitempty" enum:"none,no,lz4,lz4-v2,stub,stub-v2,disabled,off"`
	CompressionLZO       string                           `json:"compression_lzo,omitempty" enum:"none,no,yes,adaptive,asym,disabled,off"`
	AllowCompression     string                           `json:"allow_compression,omitempty" enum:"no,asym,yes"`
	RouteNoPull          bool                             `json:"route_no_pull,omitempty"`
	PullFilters          []OpenVPNPullFilterOptions       `json:"pull_filters,omitempty"`
	Routes               badoption.Listable[netip.Prefix] `json:"routes,omitempty"`
	RouteGateway         *badoption.Addr                  `json:"route_gateway,omitempty"`
	RouteMetric          int                              `json:"route_metric,omitempty"`
	RedirectGateway      bool                             `json:"redirect_gateway,omitempty"`
	RedirectGatewayFlags badoption.Listable[string]       `json:"redirect_gateway_flags,omitempty"`
	RedirectPrivate      bool                             `json:"redirect_private,omitempty"`
	BlockIPv6            bool                             `json:"block_ipv6,omitempty"`
	PingInterval         badoption.Duration               `json:"ping_interval,omitempty"`
	PingRestart          badoption.Duration               `json:"ping_restart,omitempty"`
	PingRestartDisabled  bool                             `json:"ping_restart_disabled,omitempty"`
	RenegotiateInterval  badoption.Duration               `json:"renegotiate_interval,omitempty"`
	RenegotiateDisabled  bool                             `json:"renegotiate_disabled,omitempty"`
	RenegotiateBytes     uint64                           `json:"renegotiate_bytes,omitempty"`
	RenegotiatePackets   uint64                           `json:"renegotiate_packets,omitempty"`
	TLSTimeout           badoption.Duration               `json:"tls_timeout,omitempty"`
	HandshakeWindow      badoption.Duration               `json:"handshake_window,omitempty"`
	ExplicitExitNotify   uint32                           `json:"explicit_exit_notify,omitempty"`
	UDPTimeout           UDPTimeoutCompat                 `json:"udp_timeout,omitempty"`
}

type OpenVPNControlWrapOptions added in v1.14.0

type OpenVPNControlWrapOptions struct {
	Type      string                     `json:"type,omitempty" enum:"tls_auth,tls_crypt,tls_crypt_v2"`
	Key       badoption.Listable[string] `json:"key,omitempty"`
	KeyPath   string                     `json:"key_path,omitempty"`
	Direction string                     `json:"direction,omitempty" enum:"server,client"`
}

type OpenVPNDNSServerOptions added in v1.14.0

type OpenVPNDNSServerOptions struct {
	Endpoint               string `json:"endpoint,omitempty"`
	AcceptDefaultResolvers bool   `json:"accept_default_resolvers,omitempty"`
	AcceptSearchDomain     bool   `json:"accept_search_domain,omitempty"`
}

type OpenVPNEndpointOptions added in v1.14.0

type OpenVPNEndpointOptions struct {
	System       bool           `json:"system,omitempty"`
	Name         string         `json:"name,omitempty"`
	MTU          uint32         `json:"mtu,omitempty"`
	UDPMapping   UDPNATBehavior `json:"udp_mapping,omitempty"`
	UDPFiltering UDPNATBehavior `json:"udp_filtering,omitempty"`
	UDPNATMax    uint32         `json:"udp_nat_max,omitempty"`
}

type OpenVPNInboundControlWrapOptions added in v1.14.0

type OpenVPNInboundControlWrapOptions struct {
	Type        string                     `json:"type,omitempty" enum:"tls_auth,tls_crypt,tls_crypt_v2"`
	Key         badoption.Listable[string] `json:"key,omitempty"`
	KeyPath     string                     `json:"key_path,omitempty"`
	Direction   string                     `json:"direction,omitempty" enum:"server,client"`
	ForceCookie bool                       `json:"force_cookie,omitempty"`
}

type OpenVPNInboundTLSOptions added in v1.14.0

type OpenVPNInboundTLSOptions struct {
	Certificate             badoption.Listable[string]        `json:"certificate,omitempty"`
	CertificatePath         string                            `json:"certificate_path,omitempty"`
	Key                     badoption.Listable[string]        `json:"key,omitempty"`
	KeyPath                 string                            `json:"key_path,omitempty"`
	ClientCertificate       badoption.Listable[string]        `json:"client_certificate,omitempty"`
	ClientCertificatePath   string                            `json:"client_certificate_path,omitempty"`
	VerifyClientCertificate string                            `json:"verify_client_certificate,omitempty" enum:"require,optional,none"`
	ClientName              string                            `json:"client_name,omitempty"`
	ClientNameType          string                            `json:"client_name_type,omitempty" enum:"subject,name,name-prefix"`
	PeerFingerprint         badoption.Listable[string]        `json:"peer_fingerprint,omitempty"`
	CRLPath                 string                            `json:"crl_path,omitempty"`
	RemoteCertificateKU     badoption.Listable[string]        `json:"remote_certificate_ku,omitempty"`
	RemoteCertificateEKU    string                            `json:"remote_certificate_eku,omitempty"`
	RemoteCertificateTLS    string                            `json:"remote_certificate_tls,omitempty" enum:"server,client,none"`
	CertificateProfile      string                            `json:"certificate_profile,omitempty" enum:"legacy,preferred,insecure,suiteb"`
	NSCertificateType       string                            `json:"ns_certificate_type,omitempty" enum:"server,client"`
	VersionMin              string                            `json:"version_min,omitempty" enum:"1.0,1.1,1.2,1.3"`
	VersionMax              string                            `json:"version_max,omitempty" enum:"1.0,1.1,1.2,1.3"`
	Cipher                  string                            `json:"cipher,omitempty"`
	Groups                  string                            `json:"groups,omitempty"`
	ControlWrap             *OpenVPNInboundControlWrapOptions `json:"control_wrap,omitempty"`
}

type OpenVPNOutboundTLSOptions added in v1.14.0

type OpenVPNOutboundTLSOptions struct {
	ServerName            string                     `json:"server_name,omitempty"`
	ServerNameType        string                     `json:"server_name_type,omitempty" enum:"subject,name,name-prefix"`
	Certificate           badoption.Listable[string] `json:"certificate,omitempty"`
	CertificatePath       string                     `json:"certificate_path,omitempty"`
	ClientCertificate     badoption.Listable[string] `json:"client_certificate,omitempty"`
	ClientCertificatePath string                     `json:"client_certificate_path,omitempty"`
	ClientKey             badoption.Listable[string] `json:"client_key,omitempty"`
	ClientKeyPath         string                     `json:"client_key_path,omitempty"`
	PeerFingerprint       badoption.Listable[string] `json:"peer_fingerprint,omitempty"`
	CRLPath               string                     `json:"crl_path,omitempty"`
	RemoteCertificateKU   badoption.Listable[string] `json:"remote_certificate_ku,omitempty"`
	RemoteCertificateEKU  string                     `json:"remote_certificate_eku,omitempty"`
	RemoteCertificateTLS  string                     `json:"remote_certificate_tls,omitempty" enum:"server,client,none"`
	CertificateProfile    string                     `json:"certificate_profile,omitempty" enum:"legacy,preferred,insecure,suiteb"`
	NSCertificateType     string                     `json:"ns_certificate_type,omitempty" enum:"server,client"`
	VersionMin            string                     `json:"version_min,omitempty" enum:"1.0,1.1,1.2,1.3"`
	VersionMax            string                     `json:"version_max,omitempty" enum:"1.0,1.1,1.2,1.3"`
	Cipher                string                     `json:"cipher,omitempty"`
	Groups                string                     `json:"groups,omitempty"`
	ControlWrap           *OpenVPNControlWrapOptions `json:"control_wrap,omitempty"`
}

type OpenVPNPullFilterOptions added in v1.14.0

type OpenVPNPullFilterOptions struct {
	Action string `json:"action" enum:"accept,ignore,reject"`
	Text   string `json:"text"`
}

type OpenVPNPushDNSServerOptions added in v1.14.0

type OpenVPNPushDNSServerOptions struct {
	Priority       int                        `json:"priority"`
	Addresses      badoption.Listable[string] `json:"addresses"`
	ResolveDomains badoption.Listable[string] `json:"resolve_domains,omitempty"`
	DNSSEC         string                     `json:"dnssec,omitempty" enum:"yes,optional,no"`
	Transport      string                     `json:"transport,omitempty" enum:"plain,dot,doh"`
	SNI            string                     `json:"sni,omitempty"`
}

type OpenVPNPushOptions added in v1.14.0

type OpenVPNPushOptions struct {
	Routes               badoption.Listable[netip.Prefix] `json:"routes,omitempty"`
	DNS                  badoption.Listable[netip.Addr]   `json:"dns,omitempty"`
	DNSServers           []OpenVPNPushDNSServerOptions    `json:"dns_servers,omitempty"`
	SearchDomains        badoption.Listable[string]       `json:"search_domains,omitempty"`
	DHCPOptions          badoption.Listable[string]       `json:"dhcp_options,omitempty"`
	RedirectGateway      bool                             `json:"redirect_gateway,omitempty"`
	RedirectGatewayFlags badoption.Listable[string]       `json:"redirect_gateway_flags,omitempty"`
	BlockOutsideDNS      bool                             `json:"block_outside_dns,omitempty"`
	PingInterval         badoption.Duration               `json:"ping_interval,omitempty"`
	PingRestart          badoption.Duration               `json:"ping_restart,omitempty"`
}

type OpenVPNRemoteOptions added in v1.14.0

type OpenVPNRemoteOptions struct {
	ServerOptions
	Network string `json:"network,omitempty" enum:"udp,udp4,udp6,tcp,tcp4,tcp6"`
}

type OpenVPNServerEndpointOptions added in v1.14.0

type OpenVPNServerEndpointOptions struct {
	ListenOptions
	OpenVPNEndpointOptions
	Mode                string                           `json:"mode,omitempty" enum:"tls,static_key"`
	Network             string                           `json:"network,omitempty" enum:"tcp,udp"`
	Remote              string                           `json:"remote,omitempty"`
	RemotePort          uint16                           `json:"remote_port,omitempty"`
	MaxClients          int                              `json:"max_clients,omitempty"`
	Address             badoption.Listable[netip.Prefix] `json:"address"`
	PeerAddress         *badoption.Addr                  `json:"peer_address,omitempty"`
	PeerAddressIPv6     *badoption.Addr                  `json:"peer_address_ipv6,omitempty"`
	Topology            string                           `json:"topology,omitempty" enum:"net30,p2p,subnet"`
	DuplicateCN         bool                             `json:"duplicate_cn,omitempty"`
	Users               []auth.User                      `json:"users,omitempty"`
	StaticKey           badoption.Listable[string]       `json:"static_key,omitempty"`
	StaticKeyPath       string                           `json:"static_key_path,omitempty"`
	KeyDirection        string                           `json:"key_direction,omitempty" enum:"server,client"`
	TLS                 *OpenVPNInboundTLSOptions        `json:"tls,omitempty"`
	Cipher              string                           `json:"cipher,omitempty"`
	DataCiphers         badoption.Listable[string]       `json:"data_ciphers,omitempty"`
	DataCiphersFallback string                           `json:"data_ciphers_fallback,omitempty"`
	Auth                string                           `json:"auth,omitempty"`
	MSSFix              uint32                           `json:"mss_fix,omitempty"`
	MSSFixDisabled      bool                             `json:"mss_fix_disabled,omitempty"`
	MSSFixMode          string                           `json:"mss_fix_mode,omitempty" enum:"mtu,fixed"`
	ReplayWindow        uint32                           `json:"replay_window,omitempty"`
	ReplayWindowTime    badoption.Duration               `json:"replay_window_time,omitempty"`
	Push                *OpenVPNPushOptions              `json:"push,omitempty"`
	PingInterval        badoption.Duration               `json:"ping_interval,omitempty"`
	PingRestart         badoption.Duration               `json:"ping_restart,omitempty"`
	RenegotiateInterval badoption.Duration               `json:"renegotiate_interval,omitempty"`
	RenegotiateDisabled bool                             `json:"renegotiate_disabled,omitempty"`
	RenegotiateBytes    uint64                           `json:"renegotiate_bytes,omitempty"`
	RenegotiatePackets  uint64                           `json:"renegotiate_packets,omitempty"`
	HandshakeWindow     badoption.Duration               `json:"handshake_window,omitempty"`
}

type OptimisticDNSOptions added in v1.14.0

type OptimisticDNSOptions _OptimisticDNSOptions

func (OptimisticDNSOptions) DescribeSchema added in v1.14.0

func (o OptimisticDNSOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (OptimisticDNSOptions) MarshalJSON added in v1.14.0

func (o OptimisticDNSOptions) MarshalJSON() ([]byte, error)

func (*OptimisticDNSOptions) UnmarshalJSON added in v1.14.0

func (o *OptimisticDNSOptions) UnmarshalJSON(bytes []byte) error

type Options

type Options _Options

func (Options) Comments added in v1.14.0

func (o Options) Comments() *json.CommentSet

func (Options) DescribeSchema added in v1.14.0

func (o Options) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (Options) MarshalJSONContext added in v1.14.0

func (o Options) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*Options) SetComments added in v1.14.0

func (o *Options) SetComments(comments *json.CommentSet)

func (*Options) UnmarshalJSONContext added in v1.11.0

func (o *Options) UnmarshalJSONContext(ctx context.Context, content []byte) error

type Outbound

type Outbound _Outbound

func (Outbound) DescribeSchema added in v1.14.0

func (h Outbound) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*Outbound) MarshalJSONContext added in v1.11.0

func (h *Outbound) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*Outbound) UnmarshalJSONContext added in v1.11.0

func (h *Outbound) UnmarshalJSONContext(ctx context.Context, content []byte) error

type OutboundECHOptions added in v1.1.0

type OutboundECHOptions struct {
	Enabled         bool                       `json:"enabled,omitempty"`
	Config          badoption.Listable[string] `json:"config,omitempty"`
	ConfigPath      string                     `json:"config_path,omitempty"`
	QueryServerName string                     `json:"query_server_name,omitempty"`

	// Deprecated: not supported by stdlib
	PQSignatureSchemesEnabled bool `json:"pq_signature_schemes_enabled,omitempty" schema:"omit"`
	// Deprecated: added by fault
	DynamicRecordSizingDisabled bool `json:"dynamic_record_sizing_disabled,omitempty" schema:"omit"`
}

type OutboundMultiplexOptions added in v1.7.0

type OutboundMultiplexOptions struct {
	Enabled        bool           `json:"enabled,omitempty"`
	Protocol       string         `json:"protocol,omitempty" enum:"h2mux,smux,yamux"`
	MaxConnections int            `json:"max_connections,omitempty"`
	MinStreams     int            `json:"min_streams,omitempty"`
	MaxStreams     int            `json:"max_streams,omitempty"`
	Padding        bool           `json:"padding,omitempty"`
	Brutal         *BrutalOptions `json:"brutal,omitempty"`
}

type OutboundOptionsRegistry added in v1.11.0

type OutboundOptionsRegistry interface {
	OptionTypes() []string
	CreateOptions(outboundType string) (any, bool)
}

type OutboundRealityOptions added in v1.2.0

type OutboundRealityOptions struct {
	Enabled   bool   `json:"enabled,omitempty"`
	PublicKey string `json:"public_key,omitempty"`
	ShortID   string `json:"short_id,omitempty"`
}

type OutboundTLSOptions

type OutboundTLSOptions struct {
	Enabled                    bool                                `json:"enabled,omitempty"`
	Engine                     string                              `json:"engine,omitempty" enum:"go,apple,windows"`
	DisableSNI                 bool                                `json:"disable_sni,omitempty"`
	ServerName                 string                              `json:"server_name,omitempty"`
	Insecure                   bool                                `json:"insecure,omitempty"`
	ALPN                       badoption.Listable[string]          `json:"alpn,omitempty" examples:"http/1.1,h2,h3"`
	MinVersion                 string                              `json:"min_version,omitempty" enum:"1.0,1.1,1.2,1.3"`
	MaxVersion                 string                              `json:"max_version,omitempty" enum:"1.0,1.1,1.2,1.3"`
	CipherSuites               badoption.Listable[string]          `json:"cipher_suites,omitempty"`
	CurvePreferences           badoption.Listable[CurvePreference] `json:"curve_preferences,omitempty"`
	Certificate                badoption.Listable[string]          `json:"certificate,omitempty"`
	CertificatePath            string                              `json:"certificate_path,omitempty"`
	CertificatePublicKeySHA256 badoption.Listable[[]byte]          `json:"certificate_public_key_sha256,omitempty"`
	ClientCertificate          badoption.Listable[string]          `json:"client_certificate,omitempty"`
	ClientCertificatePath      string                              `json:"client_certificate_path,omitempty"`
	ClientKey                  badoption.Listable[string]          `json:"client_key,omitempty"`
	ClientKeyPath              string                              `json:"client_key_path,omitempty"`
	Fragment                   bool                                `json:"fragment,omitempty"`
	FragmentFallbackDelay      badoption.Duration                  `json:"fragment_fallback_delay,omitempty"`
	RecordFragment             bool                                `json:"record_fragment,omitempty"`
	Spoof                      string                              `json:"spoof,omitempty"`
	SpoofMethod                string                              `json:"spoof_method,omitempty" enum:"wrong-sequence,wrong-checksum,wrong-ack,wrong-md5,wrong-timestamp"`
	KernelTx                   bool                                `json:"kernel_tx,omitempty"`
	KernelRx                   bool                                `json:"kernel_rx,omitempty"`
	HandshakeTimeout           badoption.Duration                  `json:"handshake_timeout,omitempty"`
	ECH                        *OutboundECHOptions                 `json:"ech,omitempty"`
	UTLS                       *OutboundUTLSOptions                `json:"utls,omitempty"`
	Reality                    *OutboundRealityOptions             `json:"reality,omitempty"`
}

type OutboundTLSOptionsContainer added in v1.8.0

type OutboundTLSOptionsContainer struct {
	TLS *OutboundTLSOptions `json:"tls,omitempty"`
}

func (*OutboundTLSOptionsContainer) ReplaceOutboundTLSOptions added in v1.8.0

func (o *OutboundTLSOptionsContainer) ReplaceOutboundTLSOptions(options *OutboundTLSOptions)

func (*OutboundTLSOptionsContainer) TakeOutboundTLSOptions added in v1.8.0

func (o *OutboundTLSOptionsContainer) TakeOutboundTLSOptions() *OutboundTLSOptions

type OutboundTLSOptionsWrapper added in v1.8.0

type OutboundTLSOptionsWrapper interface {
	TakeOutboundTLSOptions() *OutboundTLSOptions
	ReplaceOutboundTLSOptions(options *OutboundTLSOptions)
}

type OutboundUTLSOptions added in v1.1.0

type OutboundUTLSOptions struct {
	Enabled     bool   `json:"enabled,omitempty"`
	Fingerprint string `` /* 180-byte string literal not displayed */
}

type PlainRuleSet added in v1.8.0

type PlainRuleSet struct {
	Rules []HeadlessRule `json:"rules,omitempty"`
}

type PlainRuleSetCompat added in v1.8.0

type PlainRuleSetCompat _PlainRuleSetCompat

func (PlainRuleSetCompat) MarshalJSON added in v1.8.0

func (r PlainRuleSetCompat) MarshalJSON() ([]byte, error)

func (*PlainRuleSetCompat) UnmarshalJSON added in v1.8.0

func (r *PlainRuleSetCompat) UnmarshalJSON(bytes []byte) error

func (PlainRuleSetCompat) Upgrade added in v1.8.0

func (r PlainRuleSetCompat) Upgrade() (PlainRuleSet, error)

type QUICOptions added in v1.14.0

type QUICOptions struct {
	HTTP2Options
	InitialPacketSize       int  `json:"initial_packet_size,omitempty"`
	DisablePathMTUDiscovery bool `json:"disable_path_mtu_discovery,omitempty"`
}

type RawDNSOptions added in v1.11.10

type RawDNSOptions struct {
	Servers        []DNSServerOptions `json:"servers,omitempty"`
	Rules          []DNSRule          `json:"rules,omitempty"`
	Final          string             `json:"final,omitempty" reference:"dns_server"`
	ReverseMapping bool               `json:"reverse_mapping,omitempty"`
	DNSClientOptions
}

type RawDefaultDNSRule added in v1.11.0

type RawDefaultDNSRule struct {
	Inbound                  badoption.Listable[string]                                                  `json:"inbound,omitempty" reference:"inbound"`
	IPVersion                int                                                                         `json:"ip_version,omitempty" enum:"4,6"`
	QueryType                badoption.Listable[DNSQueryType]                                            `json:"query_type,omitempty"`
	QueryClientSubnet        badoption.Listable[*badoption.Prefixable]                                   `json:"query_client_subnet,omitempty"`
	QueryDNSSEC              bool                                                                        `json:"query_dnssec,omitempty"`
	Network                  badoption.Listable[string]                                                  `json:"network,omitempty" enum:"tcp,udp"`
	AuthUser                 badoption.Listable[string]                                                  `json:"auth_user,omitempty"`
	Protocol                 badoption.Listable[string]                                                  `json:"protocol,omitempty" enum:"tls,http,quic,dns,stun,bittorrent,dtls,ssh,rdp,ntp"`
	Domain                   badoption.Listable[string]                                                  `json:"domain,omitempty"`
	DomainSuffix             badoption.Listable[string]                                                  `json:"domain_suffix,omitempty"`
	DomainKeyword            badoption.Listable[string]                                                  `json:"domain_keyword,omitempty"`
	DomainRegex              badoption.Listable[string]                                                  `json:"domain_regex,omitempty"`
	SourceIPCIDR             badoption.Listable[string]                                                  `json:"source_ip_cidr,omitempty"`
	SourceIPIsPrivate        bool                                                                        `json:"source_ip_is_private,omitempty"`
	SourcePort               badoption.Listable[uint16]                                                  `json:"source_port,omitempty"`
	SourcePortRange          badoption.Listable[string]                                                  `json:"source_port_range,omitempty"`
	Port                     badoption.Listable[uint16]                                                  `json:"port,omitempty"`
	PortRange                badoption.Listable[string]                                                  `json:"port_range,omitempty"`
	ProcessName              badoption.Listable[string]                                                  `json:"process_name,omitempty"`
	ProcessPath              badoption.Listable[string]                                                  `json:"process_path,omitempty"`
	ProcessPathRegex         badoption.Listable[string]                                                  `json:"process_path_regex,omitempty"`
	PackageName              badoption.Listable[string]                                                  `json:"package_name,omitempty"`
	PackageNameRegex         badoption.Listable[string]                                                  `json:"package_name_regex,omitempty"`
	User                     badoption.Listable[string]                                                  `json:"user,omitempty"`
	UserID                   badoption.Listable[int32]                                                   `json:"user_id,omitempty"`
	Outbound                 badoption.Listable[string]                                                  `json:"outbound,omitempty" reference:"outbound" schema:"omit"`
	ClashMode                string                                                                      `json:"clash_mode,omitempty"`
	NetworkType              badoption.Listable[InterfaceType]                                           `json:"network_type,omitempty"`
	NetworkIsExpensive       bool                                                                        `json:"network_is_expensive,omitempty"`
	NetworkIsConstrained     bool                                                                        `json:"network_is_constrained,omitempty"`
	WIFISSID                 badoption.Listable[string]                                                  `json:"wifi_ssid,omitempty"`
	WIFIBSSID                badoption.Listable[string]                                                  `json:"wifi_bssid,omitempty"`
	InterfaceAddress         *badjson.TypedMap[string, badoption.Listable[*badoption.Prefixable]]        `json:"interface_address,omitempty"`
	NetworkInterfaceAddress  *badjson.TypedMap[InterfaceType, badoption.Listable[*badoption.Prefixable]] `json:"network_interface_address,omitempty"`
	DefaultInterfaceAddress  badoption.Listable[*badoption.Prefixable]                                   `json:"default_interface_address,omitempty"`
	SourceMACAddress         badoption.Listable[string]                                                  `json:"source_mac_address,omitempty"`
	SourceHostname           badoption.Listable[string]                                                  `json:"source_hostname,omitempty"`
	PreferredBy              badoption.Listable[string]                                                  `json:"preferred_by,omitempty"`
	RuleSet                  badoption.Listable[string]                                                  `json:"rule_set,omitempty" reference:"rule_set"`
	RuleSetIPCIDRMatchSource bool                                                                        `json:"rule_set_ip_cidr_match_source,omitempty"`
	MatchResponse            *DNSRuleMatchResponse                                                       `json:"match_response,omitempty"`
	IPCIDR                   badoption.Listable[string]                                                  `json:"ip_cidr,omitempty"`
	IPIsPrivate              bool                                                                        `json:"ip_is_private,omitempty"`
	IPAcceptAny              bool                                                                        `json:"ip_accept_any,omitempty"`
	ResponseRcode            *DNSRCode                                                                   `json:"response_rcode,omitempty"`
	ResponseAnswer           badoption.Listable[DNSRecordOptions]                                        `json:"response_answer,omitempty"`
	ResponseNs               badoption.Listable[DNSRecordOptions]                                        `json:"response_ns,omitempty"`
	ResponseExtra            badoption.Listable[DNSRecordOptions]                                        `json:"response_extra,omitempty"`
	Invert                   bool                                                                        `json:"invert,omitempty"`

	// Deprecated: removed in sing-box 1.12.0
	Geosite     badoption.Listable[string] `json:"geosite,omitempty" schema:"omit"`
	SourceGeoIP badoption.Listable[string] `json:"source_geoip,omitempty" schema:"omit"`
	GeoIP       badoption.Listable[string] `json:"geoip,omitempty" schema:"omit"`
	// Deprecated: removed in sing-box 1.11.0
	RuleSetIPCIDRAcceptEmpty bool `json:"rule_set_ip_cidr_accept_empty,omitempty" schema:"omit"`
	// Deprecated: renamed to rule_set_ip_cidr_match_source
	Deprecated_RulesetIPCIDRMatchSource bool `json:"rule_set_ipcidr_match_source,omitempty" schema:"omit"`
}

type RawDefaultRule added in v1.11.0

type RawDefaultRule struct {
	Inbound                  badoption.Listable[string]                                                  `json:"inbound,omitempty" reference:"inbound"`
	IPVersion                int                                                                         `json:"ip_version,omitempty" enum:"4,6"`
	Network                  badoption.Listable[string]                                                  `json:"network,omitempty" enum:"tcp,udp,icmp"`
	AuthUser                 badoption.Listable[string]                                                  `json:"auth_user,omitempty"`
	Protocol                 badoption.Listable[string]                                                  `json:"protocol,omitempty" enum:"tls,http,quic,dns,stun,bittorrent,dtls,ssh,rdp,ntp"`
	Client                   badoption.Listable[string]                                                  `json:"client,omitempty"`
	Domain                   badoption.Listable[string]                                                  `json:"domain,omitempty"`
	DomainSuffix             badoption.Listable[string]                                                  `json:"domain_suffix,omitempty"`
	DomainKeyword            badoption.Listable[string]                                                  `json:"domain_keyword,omitempty"`
	DomainRegex              badoption.Listable[string]                                                  `json:"domain_regex,omitempty"`
	Geosite                  badoption.Listable[string]                                                  `json:"geosite,omitempty" schema:"omit"`
	SourceGeoIP              badoption.Listable[string]                                                  `json:"source_geoip,omitempty" schema:"omit"`
	GeoIP                    badoption.Listable[string]                                                  `json:"geoip,omitempty" schema:"omit"`
	SourceIPCIDR             badoption.Listable[string]                                                  `json:"source_ip_cidr,omitempty"`
	SourceIPIsPrivate        bool                                                                        `json:"source_ip_is_private,omitempty"`
	IPCIDR                   badoption.Listable[string]                                                  `json:"ip_cidr,omitempty"`
	IPIsPrivate              bool                                                                        `json:"ip_is_private,omitempty"`
	SourcePort               badoption.Listable[uint16]                                                  `json:"source_port,omitempty"`
	SourcePortRange          badoption.Listable[string]                                                  `json:"source_port_range,omitempty"`
	Port                     badoption.Listable[uint16]                                                  `json:"port,omitempty"`
	PortRange                badoption.Listable[string]                                                  `json:"port_range,omitempty"`
	ProcessName              badoption.Listable[string]                                                  `json:"process_name,omitempty"`
	ProcessPath              badoption.Listable[string]                                                  `json:"process_path,omitempty"`
	ProcessPathRegex         badoption.Listable[string]                                                  `json:"process_path_regex,omitempty"`
	PackageName              badoption.Listable[string]                                                  `json:"package_name,omitempty"`
	PackageNameRegex         badoption.Listable[string]                                                  `json:"package_name_regex,omitempty"`
	User                     badoption.Listable[string]                                                  `json:"user,omitempty"`
	UserID                   badoption.Listable[int32]                                                   `json:"user_id,omitempty"`
	ClashMode                string                                                                      `json:"clash_mode,omitempty"`
	NetworkType              badoption.Listable[InterfaceType]                                           `json:"network_type,omitempty"`
	NetworkIsExpensive       bool                                                                        `json:"network_is_expensive,omitempty"`
	NetworkIsConstrained     bool                                                                        `json:"network_is_constrained,omitempty"`
	WIFISSID                 badoption.Listable[string]                                                  `json:"wifi_ssid,omitempty"`
	WIFIBSSID                badoption.Listable[string]                                                  `json:"wifi_bssid,omitempty"`
	InterfaceAddress         *badjson.TypedMap[string, badoption.Listable[*badoption.Prefixable]]        `json:"interface_address,omitempty"`
	NetworkInterfaceAddress  *badjson.TypedMap[InterfaceType, badoption.Listable[*badoption.Prefixable]] `json:"network_interface_address,omitempty"`
	DefaultInterfaceAddress  badoption.Listable[*badoption.Prefixable]                                   `json:"default_interface_address,omitempty"`
	SourceMACAddress         badoption.Listable[string]                                                  `json:"source_mac_address,omitempty"`
	SourceHostname           badoption.Listable[string]                                                  `json:"source_hostname,omitempty"`
	PreferredBy              badoption.Listable[string]                                                  `json:"preferred_by,omitempty"`
	RuleSet                  badoption.Listable[string]                                                  `json:"rule_set,omitempty" reference:"rule_set"`
	RuleSetIPCIDRMatchSource bool                                                                        `json:"rule_set_ip_cidr_match_source,omitempty"`
	Invert                   bool                                                                        `json:"invert,omitempty"`

	// Deprecated: renamed to rule_set_ip_cidr_match_source
	Deprecated_RulesetIPCIDRMatchSource bool `json:"rule_set_ipcidr_match_source,omitempty" schema:"omit"`
}

type RawLocalDNSServerOptions added in v1.13.0

type RawLocalDNSServerOptions struct {
	DialerOptions
}

type RawLogicalDNSRule added in v1.11.0

type RawLogicalDNSRule struct {
	Mode   string    `json:"mode" enum:"and,or"`
	Rules  []DNSRule `json:"rules,omitempty"`
	Invert bool      `json:"invert,omitempty"`
}

type RawLogicalRule added in v1.11.0

type RawLogicalRule struct {
	Mode   string `json:"mode" enum:"and,or"`
	Rules  []Rule `json:"rules,omitempty"`
	Invert bool   `json:"invert,omitempty"`
}

type RawRouteOptionsActionOptions added in v1.11.0

type RawRouteOptionsActionOptions struct {
	OverrideAddress string `json:"override_address,omitempty"`
	OverridePort    uint16 `json:"override_port,omitempty"`

	NetworkStrategy *NetworkStrategy `json:"network_strategy,omitempty"`
	FallbackDelay   uint32           `json:"fallback_delay,omitempty"`

	UDPDisableDomainUnmapping bool               `json:"udp_disable_domain_unmapping,omitempty"`
	UDPConnect                bool               `json:"udp_connect,omitempty"`
	UDPTimeout                badoption.Duration `json:"udp_timeout,omitempty"`

	TLSFragment              bool               `json:"tls_fragment,omitempty"`
	TLSFragmentFallbackDelay badoption.Duration `json:"tls_fragment_fallback_delay,omitempty"`
	TLSRecordFragment        bool               `json:"tls_record_fragment,omitempty"`
	TLSSpoof                 string             `json:"tls_spoof,omitempty"`
	TLSSpoofMethod           string             `json:"tls_spoof_method,omitempty" enum:"wrong-sequence,wrong-checksum,wrong-ack,wrong-md5,wrong-timestamp"`
}

type RedirectInboundOptions

type RedirectInboundOptions struct {
	ListenOptions
}

type RejectActionOptions added in v1.11.0

type RejectActionOptions _RejectActionOptions

func (RejectActionOptions) MarshalJSON added in v1.11.9

func (r RejectActionOptions) MarshalJSON() ([]byte, error)

func (*RejectActionOptions) UnmarshalJSON added in v1.11.0

func (r *RejectActionOptions) UnmarshalJSON(bytes []byte) error

type RemoteDNSServerOptions added in v1.11.10

type RemoteDNSServerOptions struct {
	RawLocalDNSServerOptions
	DNSServerAddressOptions
}

type RemoteHTTPSDNSServerOptions added in v1.11.10

type RemoteHTTPSDNSServerOptions struct {
	RemoteTLSDNSServerOptions
	Path    string               `json:"path,omitempty"`
	Method  string               `json:"method,omitempty"`
	Headers badoption.HTTPHeader `json:"headers,omitempty"`
}

type RemoteRuleSet added in v1.8.0

type RemoteRuleSet struct {
	URL            string             `json:"url"`
	InitialPath    string             `json:"initial_path,omitempty"`
	HTTPClient     *HTTPClientOptions `json:"http_client,omitempty"`
	UpdateInterval badoption.Duration `json:"update_interval,omitempty"`
	// Deprecated: use http_client instead
	DownloadDetour string `json:"download_detour,omitempty" reference:"outbound" schema:"omit"`
}

type RemoteTLSDNSServerOptions added in v1.11.10

type RemoteTLSDNSServerOptions struct {
	RemoteDNSServerOptions
	OutboundTLSOptionsContainer
}

type ResolvedDNSServerOptions added in v1.12.0

type ResolvedDNSServerOptions struct {
	Service                string `json:"service"`
	AcceptDefaultResolvers bool   `json:"accept_default_resolvers,omitempty"`
}

type ResolvedServiceOptions added in v1.12.0

type ResolvedServiceOptions _ResolvedServiceOptions

func (ResolvedServiceOptions) DescribeSchema added in v1.14.0

func (r ResolvedServiceOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (ResolvedServiceOptions) MarshalJSONContext added in v1.12.0

func (r ResolvedServiceOptions) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*ResolvedServiceOptions) UnmarshalJSONContext added in v1.12.0

func (r *ResolvedServiceOptions) UnmarshalJSONContext(ctx context.Context, bytes []byte) error

type RouteActionOptions added in v1.11.0

type RouteActionOptions struct {
	Outbound string `json:"outbound,omitempty" reference:"outbound"`
	RawRouteOptionsActionOptions
}

type RouteActionResolve added in v1.11.0

type RouteActionResolve struct {
	Server                 string                `json:"server,omitempty" reference:"dns_server"`
	Timeout                badoption.Duration    `json:"timeout,omitempty"`
	Strategy               DomainStrategy        `json:"strategy,omitempty"`
	DisableCache           bool                  `json:"disable_cache,omitempty"`
	DisableOptimisticCache bool                  `json:"disable_optimistic_cache,omitempty"`
	RewriteTTL             *uint32               `json:"rewrite_ttl,omitempty"`
	ClientSubnet           *badoption.Prefixable `json:"client_subnet,omitempty"`
}

type RouteActionSniff added in v1.11.0

type RouteActionSniff struct {
	Sniffer badoption.Listable[string] `json:"sniffer,omitempty" enum:"tls,http,quic,dns,stun,bittorrent,dtls,ssh,rdp,ntp"`
	Timeout badoption.Duration         `json:"timeout,omitempty"`
}

type RouteOptions

type RouteOptions struct {
	GeoIP                      *GeoIPOptions                     `json:"geoip,omitempty" schema:"omit"`
	Geosite                    *GeositeOptions                   `json:"geosite,omitempty" schema:"omit"`
	Rules                      []Rule                            `json:"rules,omitempty"`
	RuleSet                    []RuleSet                         `json:"rule_set,omitempty"`
	Final                      string                            `json:"final,omitempty" reference:"outbound"`
	FindProcess                bool                              `json:"find_process,omitempty"`
	FindNeighbor               bool                              `json:"find_neighbor,omitempty"`
	DHCPLeaseFiles             badoption.Listable[string]        `json:"dhcp_lease_files,omitempty"`
	AutoDetectInterface        bool                              `json:"auto_detect_interface,omitempty"`
	OverrideAndroidVPN         bool                              `json:"override_android_vpn,omitempty"`
	DefaultInterface           string                            `json:"default_interface,omitempty"`
	DefaultMark                FwMark                            `json:"default_mark,omitempty"`
	DefaultDomainResolver      *DomainResolveOptions             `json:"default_domain_resolver,omitempty"`
	DefaultNetworkStrategy     *NetworkStrategy                  `json:"default_network_strategy,omitempty"`
	DefaultNetworkType         badoption.Listable[InterfaceType] `json:"default_network_type,omitempty"`
	DefaultFallbackNetworkType badoption.Listable[InterfaceType] `json:"default_fallback_network_type,omitempty"`
	DefaultFallbackDelay       badoption.Duration                `json:"default_fallback_delay,omitempty"`
	DefaultHTTPClient          string                            `json:"default_http_client,omitempty"`
}

type RouteOptionsActionOptions added in v1.11.0

type RouteOptionsActionOptions RawRouteOptionsActionOptions

func (*RouteOptionsActionOptions) UnmarshalJSON added in v1.11.0

func (r *RouteOptionsActionOptions) UnmarshalJSON(data []byte) error

type Rule

type Rule _Rule

func (Rule) DescribeSchema added in v1.14.0

func (r Rule) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (Rule) IsValid added in v1.8.0

func (r Rule) IsValid() bool

func (Rule) MarshalJSON

func (r Rule) MarshalJSON() ([]byte, error)

func (*Rule) UnmarshalJSONContext added in v1.14.0

func (r *Rule) UnmarshalJSONContext(ctx context.Context, bytes []byte) error

type RuleAction added in v1.11.0

type RuleAction _RuleAction

func (RuleAction) MarshalJSON added in v1.11.0

func (r RuleAction) MarshalJSON() ([]byte, error)

func (*RuleAction) UnmarshalJSON added in v1.11.0

func (r *RuleAction) UnmarshalJSON(data []byte) error

type RuleSet added in v1.8.0

type RuleSet _RuleSet

func (RuleSet) DescribeSchema added in v1.14.0

func (r RuleSet) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (RuleSet) MarshalJSON added in v1.8.0

func (r RuleSet) MarshalJSON() ([]byte, error)

func (*RuleSet) UnmarshalJSON added in v1.8.0

func (r *RuleSet) UnmarshalJSON(bytes []byte) error

type SOCKSOutboundOptions added in v1.11.0

type SOCKSOutboundOptions struct {
	DialerOptions
	ServerOptions
	Version    string             `json:"version,omitempty" enum:"4,4a,5"`
	Username   string             `json:"username,omitempty"`
	Password   string             `json:"password,omitempty"`
	Network    NetworkList        `json:"network,omitempty"`
	UDPOverTCP *UDPOverTCPOptions `json:"udp_over_tcp,omitempty"`
}

type SSHOutboundOptions added in v1.0.1

type SSHOutboundOptions struct {
	DialerOptions
	ServerOptions
	User                 string                     `json:"user,omitempty"`
	Password             string                     `json:"password,omitempty"`
	PrivateKey           badoption.Listable[string] `json:"private_key,omitempty"`
	PrivateKeyPath       string                     `json:"private_key_path,omitempty"`
	PrivateKeyPassphrase string                     `json:"private_key_passphrase,omitempty"`
	HostKey              badoption.Listable[string] `json:"host_key,omitempty"`
	HostKeyAlgorithms    badoption.Listable[string] `json:"host_key_algorithms,omitempty"`
	ClientVersion        string                     `json:"client_version,omitempty"`
	Cipher               badoption.Listable[string] `json:"cipher,omitempty"`
	MAC                  badoption.Listable[string] `json:"mac,omitempty"`
	KexAlgorithm         badoption.Listable[string] `json:"kex_algorithm,omitempty"`
}

type SSMAPIServiceOptions added in v1.12.0

type SSMAPIServiceOptions struct {
	ListenOptions
	Servers   *badjson.TypedMap[string, string] `json:"servers"`
	CachePath string                            `json:"cache_path,omitempty"`
	InboundTLSOptionsContainer
}

type SelectorOutboundOptions

type SelectorOutboundOptions struct {
	Outbounds                 []string `json:"outbounds" reference:"outbound"`
	Default                   string   `json:"default,omitempty" reference:"outbound"`
	InterruptExistConnections bool     `json:"interrupt_exist_connections,omitempty"`
}

type ServerOptions

type ServerOptions struct {
	Server     string `json:"server"`
	ServerPort uint16 `json:"server_port"`
}

func (ServerOptions) Build

func (o ServerOptions) Build() M.Socksaddr

func (*ServerOptions) ReplaceServerOptions added in v1.8.0

func (o *ServerOptions) ReplaceServerOptions(options ServerOptions)

func (ServerOptions) ServerIsDomain added in v1.11.10

func (o ServerOptions) ServerIsDomain() bool

func (*ServerOptions) TakeServerOptions added in v1.8.0

func (o *ServerOptions) TakeServerOptions() ServerOptions

type ServerOptionsWrapper added in v1.8.0

type ServerOptionsWrapper interface {
	TakeServerOptions() ServerOptions
	ReplaceServerOptions(options ServerOptions)
}

type Service added in v1.12.0

type Service _Service

func (Service) DescribeSchema added in v1.14.0

func (h Service) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (*Service) MarshalJSONContext added in v1.12.0

func (h *Service) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*Service) UnmarshalJSONContext added in v1.12.0

func (h *Service) UnmarshalJSONContext(ctx context.Context, content []byte) error

type ServiceOptionsRegistry added in v1.12.0

type ServiceOptionsRegistry interface {
	OptionTypes() []string
	CreateOptions(serviceType string) (any, bool)
}

type ShadowTLSHandshakeOptions added in v1.0.1

type ShadowTLSHandshakeOptions struct {
	ServerOptions
	DialerOptions
}

type ShadowTLSInboundOptions added in v1.0.1

type ShadowTLSInboundOptions struct {
	ListenOptions
	Version                int                                                  `json:"version,omitempty" enum:"1,2,3"`
	Password               string                                               `json:"password,omitempty"`
	Users                  []ShadowTLSUser                                      `json:"users,omitempty"`
	Handshake              ShadowTLSHandshakeOptions                            `json:"handshake,omitempty"`
	HandshakeForServerName *badjson.TypedMap[string, ShadowTLSHandshakeOptions] `json:"handshake_for_server_name,omitempty"`
	StrictMode             bool                                                 `json:"strict_mode,omitempty"`
	WildcardSNI            WildcardSNI                                          `json:"wildcard_sni,omitempty"`
}

type ShadowTLSOutboundOptions added in v1.0.1

type ShadowTLSOutboundOptions struct {
	DialerOptions
	ServerOptions
	Version  int    `json:"version,omitempty" enum:"1,2,3"`
	Password string `json:"password,omitempty"`
	OutboundTLSOptionsContainer
}

type ShadowTLSUser added in v1.2.0

type ShadowTLSUser struct {
	Name     string `json:"name,omitempty"`
	Password string `json:"password,omitempty"`
}

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                   `` /* 186-byte string literal not displayed */
	Password     string                   `json:"password,omitempty"`
	Users        []ShadowsocksUser        `json:"users,omitempty"`
	Destinations []ShadowsocksDestination `json:"destinations,omitempty"`
	Multiplex    *InboundMultiplexOptions `json:"multiplex,omitempty"`
	Managed      bool                     `json:"managed,omitempty"`
}

type ShadowsocksOutboundOptions

type ShadowsocksOutboundOptions struct {
	DialerOptions
	ServerOptions
	Method        string                    `` /* 290-byte string literal not displayed */
	Password      string                    `json:"password"`
	Plugin        string                    `json:"plugin,omitempty"`
	PluginOptions string                    `json:"plugin_opts,omitempty"`
	Network       NetworkList               `json:"network,omitempty"`
	UDPOverTCP    *UDPOverTCPOptions        `json:"udp_over_tcp,omitempty"`
	Multiplex     *OutboundMultiplexOptions `json:"multiplex,omitempty"`
}

type ShadowsocksROutboundOptions added in v1.1.0

type ShadowsocksROutboundOptions struct {
	DialerOptions
	ServerOptions
	Method        string      `json:"method"`
	Password      string      `json:"password"`
	Obfs          string      `json:"obfs,omitempty"`
	ObfsParam     string      `json:"obfs_param,omitempty"`
	Protocol      string      `json:"protocol,omitempty"`
	ProtocolParam string      `json:"protocol_param,omitempty"`
	Network       NetworkList `json:"network,omitempty"`
}

type ShadowsocksUser

type ShadowsocksUser struct {
	Name     string `json:"name"`
	Password string `json:"password"`
}

type SnellInboundOptions added in v1.14.0

type SnellInboundOptions _SnellInboundOptions

func (SnellInboundOptions) DescribeSchema added in v1.14.0

func (o SnellInboundOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (SnellInboundOptions) MarshalJSON added in v1.14.0

func (o SnellInboundOptions) MarshalJSON() ([]byte, error)

func (*SnellInboundOptions) UnmarshalJSON added in v1.14.0

func (o *SnellInboundOptions) UnmarshalJSON(content []byte) error

type SnellObfsClientOptions added in v1.14.0

type SnellObfsClientOptions struct {
	ObfsMode string `json:"obfs_mode,omitempty" enum:"none,http,tls"`
	ObfsHost string `json:"obfs_host,omitempty"`
}

type SnellObfsServerOptions added in v1.14.0

type SnellObfsServerOptions struct {
	ObfsMode string `json:"obfs_mode,omitempty" enum:"none,http,tls"`
}

type SnellOutboundOptions added in v1.14.0

type SnellOutboundOptions _SnellOutboundOptions

func (SnellOutboundOptions) DescribeSchema added in v1.14.0

func (o SnellOutboundOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (SnellOutboundOptions) MarshalJSON added in v1.14.0

func (o SnellOutboundOptions) MarshalJSON() ([]byte, error)

func (*SnellOutboundOptions) UnmarshalJSON added in v1.14.0

func (o *SnellOutboundOptions) UnmarshalJSON(content []byte) error

type SnellUser added in v1.14.0

type SnellUser struct {
	Name    string `json:"name,omitempty"`
	UserKey string `json:"userkey"`
}

type SnellV6Options added in v1.14.0

type SnellV6Options struct {
	Mode string `json:"mode,omitempty" enum:"default,unshaped,unsafe-raw"`
}

type SocksInboundOptions

type SocksInboundOptions struct {
	ListenOptions
	Users          []auth.User           `json:"users,omitempty"`
	DomainResolver *DomainResolveOptions `json:"domain_resolver,omitempty"`
}

type StubOptions added in v1.11.0

type StubOptions struct{}

type TProxyInboundOptions

type TProxyInboundOptions struct {
	ListenOptions
	Network      NetworkList    `json:"network,omitempty"`
	UDPMapping   UDPNATBehavior `json:"udp_mapping,omitempty"`
	UDPFiltering UDPNATBehavior `json:"udp_filtering,omitempty"`
	UDPNATMax    uint32         `json:"udp_nat_max,omitempty"`
}

type TUICInboundOptions added in v1.4.0

type TUICInboundOptions struct {
	ListenOptions
	Users             []TUICUser         `json:"users,omitempty"`
	CongestionControl string             `json:"congestion_control,omitempty" enum:"cubic,new_reno,bbr"`
	AuthTimeout       badoption.Duration `json:"auth_timeout,omitempty"`
	ZeroRTTHandshake  bool               `json:"zero_rtt_handshake,omitempty"`
	Heartbeat         badoption.Duration `json:"heartbeat,omitempty"`
	InboundTLSOptionsContainer
	QUICOptions
}

type TUICOutboundOptions added in v1.4.0

type TUICOutboundOptions struct {
	DialerOptions
	ServerOptions
	UUID              string             `json:"uuid,omitempty"`
	Password          string             `json:"password,omitempty"`
	CongestionControl string             `json:"congestion_control,omitempty" enum:"cubic,new_reno,bbr"`
	UDPRelayMode      string             `json:"udp_relay_mode,omitempty" enum:"native,quic"`
	UDPOverStream     bool               `json:"udp_over_stream,omitempty"`
	ZeroRTTHandshake  bool               `json:"zero_rtt_handshake,omitempty"`
	Heartbeat         badoption.Duration `json:"heartbeat,omitempty"`
	Network           NetworkList        `json:"network,omitempty"`
	OutboundTLSOptionsContainer
	QUICOptions
}

type TUICUser added in v1.4.0

type TUICUser struct {
	Name     string `json:"name,omitempty"`
	UUID     string `json:"uuid,omitempty"`
	Password string `json:"password,omitempty"`
}

type TailscaleCertificateProviderOptions added in v1.14.0

type TailscaleCertificateProviderOptions struct {
	Endpoint string `json:"endpoint,omitempty"`
}

type TailscaleDNSServerOptions added in v1.11.10

type TailscaleDNSServerOptions struct {
	Endpoint               string `json:"endpoint,omitempty"`
	AcceptDefaultResolvers bool   `json:"accept_default_resolvers,omitempty"`
	AcceptSearchDomain     bool   `json:"accept_search_domain,omitempty"`
}

type TailscaleEndpointOptions added in v1.11.10

type TailscaleEndpointOptions struct {
	DialerOptions
	StateDirectory             string                     `json:"state_directory,omitempty"`
	AuthKey                    string                     `json:"auth_key,omitempty"`
	ControlURL                 string                     `json:"control_url,omitempty"`
	Ephemeral                  bool                       `json:"ephemeral,omitempty"`
	Hostname                   string                     `json:"hostname,omitempty"`
	AcceptRoutes               bool                       `json:"accept_routes,omitempty"`
	ExitNode                   string                     `json:"exit_node,omitempty"`
	ExitNodeAllowLANAccess     bool                       `json:"exit_node_allow_lan_access,omitempty"`
	AdvertiseRoutes            []netip.Prefix             `json:"advertise_routes,omitempty"`
	AdvertiseExitNode          bool                       `json:"advertise_exit_node,omitempty"`
	AdvertiseTags              badoption.Listable[string] `json:"advertise_tags,omitempty"`
	ListenPort                 uint16                     `json:"listen_port,omitempty"`
	RelayServerPort            *uint16                    `json:"relay_server_port,omitempty"`
	RelayServerStaticEndpoints []netip.AddrPort           `json:"relay_server_static_endpoints,omitempty"`
	SystemInterface            bool                       `json:"system_interface,omitempty"`
	SystemInterfaceName        string                     `json:"system_interface_name,omitempty"`
	SystemInterfaceMTU         uint32                     `json:"system_interface_mtu,omitempty"`
	UDPTimeout                 UDPTimeoutCompat           `json:"udp_timeout,omitempty"`
	SSHServer                  *TailscaleSSHServerOptions `json:"ssh_server,omitempty"`
	TaildropDirectory          string                     `json:"taildrop_directory,omitempty"`
}

type TailscaleSSHServerOptions added in v1.14.0

type TailscaleSSHServerOptions _TailscaleSSHServerOptions

func (TailscaleSSHServerOptions) DescribeSchema added in v1.14.0

func (o TailscaleSSHServerOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (TailscaleSSHServerOptions) MarshalJSON added in v1.14.0

func (o TailscaleSSHServerOptions) MarshalJSON() ([]byte, error)

func (*TailscaleSSHServerOptions) UnmarshalJSON added in v1.14.0

func (o *TailscaleSSHServerOptions) UnmarshalJSON(bytes []byte) error

type TorOutboundOptions added in v1.0.1

type TorOutboundOptions struct {
	DialerOptions
	ExecutablePath string            `json:"executable_path,omitempty"`
	ExtraArgs      []string          `json:"extra_args,omitempty"`
	DataDirectory  string            `json:"data_directory,omitempty"`
	Options        map[string]string `json:"torrc,omitempty"`
}

type TrojanInboundOptions

type TrojanInboundOptions struct {
	ListenOptions
	Users []TrojanUser `json:"users,omitempty"`
	InboundTLSOptionsContainer
	Fallback        *ServerOptions            `json:"fallback,omitempty"`
	FallbackForALPN map[string]*ServerOptions `json:"fallback_for_alpn,omitempty"`
	Multiplex       *InboundMultiplexOptions  `json:"multiplex,omitempty"`
	Transport       *V2RayTransportOptions    `json:"transport,omitempty"`
}

type TrojanOutboundOptions

type TrojanOutboundOptions struct {
	DialerOptions
	ServerOptions
	Password string      `json:"password"`
	Network  NetworkList `json:"network,omitempty"`
	OutboundTLSOptionsContainer
	Multiplex *OutboundMultiplexOptions `json:"multiplex,omitempty"`
	Transport *V2RayTransportOptions    `json:"transport,omitempty"`
}

type TrojanUser

type TrojanUser struct {
	Name     string `json:"name"`
	Password string `json:"password"`
}

type TunInboundOptions

type TunInboundOptions struct {
	InterfaceName                 string                           `json:"interface_name,omitempty"`
	NetNs                         string                           `json:"netns,omitempty" reference:"network_namespace"`
	MTU                           uint32                           `json:"mtu,omitempty"`
	Address                       badoption.Listable[netip.Prefix] `json:"address,omitempty" examples:"172.19.0.1/30,fdfe:dcba:9876::1/126"`
	DNSMode                       string                           `json:"dns_mode,omitempty" enum:"disabled,native,hijack"`
	DNSAddress                    badoption.Listable[netip.Addr]   `json:"dns_address,omitempty"`
	AutoRoute                     bool                             `json:"auto_route,omitempty"`
	IPRoute2TableIndex            int                              `json:"iproute2_table_index,omitempty"`
	IPRoute2RuleIndex             int                              `json:"iproute2_rule_index,omitempty"`
	AutoRedirect                  bool                             `json:"auto_redirect,omitempty"`
	AutoRedirectInputMark         FwMark                           `json:"auto_redirect_input_mark,omitempty"`
	AutoRedirectOutputMark        FwMark                           `json:"auto_redirect_output_mark,omitempty"`
	AutoRedirectResetMark         FwMark                           `json:"auto_redirect_reset_mark,omitempty"`
	AutoRedirectNFQueue           uint16                           `json:"auto_redirect_nfqueue,omitempty"`
	AutoRedirectFallbackRuleIndex int                              `json:"auto_redirect_iproute2_fallback_rule_index,omitempty"`
	ExcludeMPTCP                  bool                             `json:"exclude_mptcp,omitempty"`
	LoopbackAddress               badoption.Listable[netip.Addr]   `json:"loopback_address,omitempty"`
	StrictRoute                   bool                             `json:"strict_route,omitempty"`
	RouteAddress                  badoption.Listable[netip.Prefix] `json:"route_address,omitempty"`
	RouteAddressSet               badoption.Listable[string]       `json:"route_address_set,omitempty"`
	RouteExcludeAddress           badoption.Listable[netip.Prefix] `json:"route_exclude_address,omitempty"`
	RouteExcludeAddressSet        badoption.Listable[string]       `json:"route_exclude_address_set,omitempty"`
	IncludeInterface              badoption.Listable[string]       `json:"include_interface,omitempty"`
	ExcludeInterface              badoption.Listable[string]       `json:"exclude_interface,omitempty"`
	IncludeUID                    badoption.Listable[uint32]       `json:"include_uid,omitempty"`
	IncludeUIDRange               badoption.Listable[string]       `json:"include_uid_range,omitempty"`
	ExcludeUID                    badoption.Listable[uint32]       `json:"exclude_uid,omitempty"`
	ExcludeUIDRange               badoption.Listable[string]       `json:"exclude_uid_range,omitempty"`
	IncludeAndroidUser            badoption.Listable[int]          `json:"include_android_user,omitempty"`
	IncludePackage                badoption.Listable[string]       `json:"include_package,omitempty"`
	ExcludePackage                badoption.Listable[string]       `json:"exclude_package,omitempty"`
	IncludeMACAddress             badoption.Listable[string]       `json:"include_mac_address,omitempty"`
	ExcludeMACAddress             badoption.Listable[string]       `json:"exclude_mac_address,omitempty"`
	UDPTimeout                    UDPTimeoutCompat                 `json:"udp_timeout,omitempty"`
	UDPMapping                    UDPNATBehavior                   `json:"udp_mapping,omitempty"`
	UDPFiltering                  UDPNATBehavior                   `json:"udp_filtering,omitempty"`
	UDPNATMax                     uint32                           `json:"udp_nat_max,omitempty"`
	Stack                         string                           `json:"stack,omitempty" enum:"system,gvisor,mixed"`
	Platform                      *TunPlatformOptions              `json:"platform,omitempty"`
	InboundOptions

	// Deprecated: removed
	GSO bool `json:"gso,omitempty" schema:"omit"`
	// Deprecated: merged to Address
	Inet4Address badoption.Listable[netip.Prefix] `json:"inet4_address,omitempty" schema:"omit"`
	// Deprecated: merged to Address
	Inet6Address badoption.Listable[netip.Prefix] `json:"inet6_address,omitempty" schema:"omit"`
	// Deprecated: merged to RouteAddress
	Inet4RouteAddress badoption.Listable[netip.Prefix] `json:"inet4_route_address,omitempty" schema:"omit"`
	// Deprecated: merged to RouteAddress
	Inet6RouteAddress badoption.Listable[netip.Prefix] `json:"inet6_route_address,omitempty" schema:"omit"`
	// Deprecated: merged to RouteExcludeAddress
	Inet4RouteExcludeAddress badoption.Listable[netip.Prefix] `json:"inet4_route_exclude_address,omitempty" schema:"omit"`
	// Deprecated: merged to RouteExcludeAddress
	Inet6RouteExcludeAddress badoption.Listable[netip.Prefix] `json:"inet6_route_exclude_address,omitempty" schema:"omit"`
	// Deprecated: removed
	EndpointIndependentNat bool `json:"endpoint_independent_nat,omitempty" schema:"omit"`
}

type TunPlatformOptions added in v1.2.0

type TunPlatformOptions struct {
	HTTPProxy *HTTPProxyOptions `json:"http_proxy,omitempty"`
}

type UDPNATBehavior added in v1.14.0

type UDPNATBehavior uint8
const (
	UDPNATBehaviorEndpointIndependent UDPNATBehavior = iota
	UDPNATBehaviorAddressDependent
	UDPNATBehaviorAddressAndPortDependent
)

func (UDPNATBehavior) DescribeSchema added in v1.14.0

func (b UDPNATBehavior) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (UDPNATBehavior) MarshalJSON added in v1.14.0

func (b UDPNATBehavior) MarshalJSON() ([]byte, error)

func (*UDPNATBehavior) UnmarshalJSON added in v1.14.0

func (b *UDPNATBehavior) UnmarshalJSON(data []byte) error

type UDPOverTCPOptions added in v1.2.0

type UDPOverTCPOptions _UDPOverTCPOptions

func (UDPOverTCPOptions) DescribeSchema added in v1.14.0

func (o UDPOverTCPOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (UDPOverTCPOptions) MarshalJSON added in v1.2.0

func (o UDPOverTCPOptions) MarshalJSON() ([]byte, error)

func (*UDPOverTCPOptions) UnmarshalJSON added in v1.2.0

func (o *UDPOverTCPOptions) UnmarshalJSON(bytes []byte) error

type UDPTimeoutCompat added in v1.7.6

type UDPTimeoutCompat badoption.Duration

func (UDPTimeoutCompat) DescribeSchema added in v1.14.0

func (c UDPTimeoutCompat) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (UDPTimeoutCompat) MarshalJSON added in v1.7.7

func (c UDPTimeoutCompat) MarshalJSON() ([]byte, error)

func (*UDPTimeoutCompat) UnmarshalJSON added in v1.7.6

func (c *UDPTimeoutCompat) UnmarshalJSON(data []byte) error

type URLTestOutboundOptions added in v1.1.0

type URLTestOutboundOptions struct {
	Outbounds                 []string           `json:"outbounds" reference:"outbound"`
	URL                       string             `json:"url,omitempty"`
	Interval                  badoption.Duration `json:"interval,omitempty"`
	Tolerance                 uint16             `json:"tolerance,omitempty"`
	IdleTimeout               badoption.Duration `json:"idle_timeout,omitempty"`
	InterruptExistConnections bool               `json:"interrupt_exist_connections,omitempty"`
}

type USBIPClientServiceOptions added in v1.14.0

type USBIPClientServiceOptions struct {
	DialerOptions
	ServerOptions
	Devices []USBIPDeviceMatch `json:"devices,omitempty"`
}

type USBIPDefaultProviderOptions added in v1.14.0

type USBIPDefaultProviderOptions struct {
	Devices []USBIPDeviceMatch `json:"devices,omitempty"`
}

type USBIPDeviceMatch added in v1.14.0

type USBIPDeviceMatch struct {
	BusID     string `json:"bus_id,omitempty"`
	VendorID  uint16 `json:"vendor_id,omitempty"`
	ProductID uint16 `json:"product_id,omitempty"`
	Serial    string `json:"serial,omitempty"`
}

type USBIPDynamicProviderOptions added in v1.14.0

type USBIPDynamicProviderOptions struct{}

type USBIPServerServiceOptions added in v1.14.0

type USBIPServerServiceOptions _USBIPServerServiceOptions

func (USBIPServerServiceOptions) DescribeSchema added in v1.14.0

func (o USBIPServerServiceOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (USBIPServerServiceOptions) MarshalJSON added in v1.14.0

func (o USBIPServerServiceOptions) MarshalJSON() ([]byte, error)

func (*USBIPServerServiceOptions) UnmarshalJSON added in v1.14.0

func (o *USBIPServerServiceOptions) UnmarshalJSON(content []byte) error

type UnshareNetworkNamespaceOptions added in v1.14.0

type UnshareNetworkNamespaceOptions struct {
	PidFile string `json:"pid_file,omitempty"`
}

type V2RayAPIOptions added in v1.1.0

type V2RayAPIOptions struct {
	Listen string                    `json:"listen,omitempty"`
	Stats  *V2RayStatsServiceOptions `json:"stats,omitempty"`
}

type V2RayGRPCOptions added in v1.0.1

type V2RayGRPCOptions struct {
	ServiceName         string             `json:"service_name,omitempty"`
	IdleTimeout         badoption.Duration `json:"idle_timeout,omitempty"`
	PingTimeout         badoption.Duration `json:"ping_timeout,omitempty"`
	PermitWithoutStream bool               `json:"permit_without_stream,omitempty"`
	ForceLite           bool               `json:"-"` // for test
}

type V2RayHTTPOptions added in v1.0.1

type V2RayHTTPOptions struct {
	Host        badoption.Listable[string] `json:"host,omitempty"`
	Path        string                     `json:"path,omitempty"`
	Method      string                     `json:"method,omitempty"`
	Headers     badoption.HTTPHeader       `json:"headers,omitempty"`
	IdleTimeout badoption.Duration         `json:"idle_timeout,omitempty"`
	PingTimeout badoption.Duration         `json:"ping_timeout,omitempty"`
}

type V2RayHTTPUpgradeOptions added in v1.7.0

type V2RayHTTPUpgradeOptions struct {
	Host    string               `json:"host,omitempty"`
	Path    string               `json:"path,omitempty"`
	Headers badoption.HTTPHeader `json:"headers,omitempty"`
}

type V2RayQUICOptions added in v1.0.1

type V2RayQUICOptions struct{}

type V2RayStatsServiceOptions added in v1.1.0

type V2RayStatsServiceOptions struct {
	Enabled   bool     `json:"enabled,omitempty"`
	Inbounds  []string `json:"inbounds,omitempty"`
	Outbounds []string `json:"outbounds,omitempty"`
	Users     []string `json:"users,omitempty"`
}

type V2RayTransportOptions added in v1.0.1

type V2RayTransportOptions _V2RayTransportOptions

func (V2RayTransportOptions) DescribeSchema added in v1.14.0

func (o V2RayTransportOptions) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (V2RayTransportOptions) MarshalJSON added in v1.0.1

func (o V2RayTransportOptions) MarshalJSON() ([]byte, error)

func (*V2RayTransportOptions) UnmarshalJSON added in v1.0.1

func (o *V2RayTransportOptions) UnmarshalJSON(bytes []byte) error

type V2RayWebsocketOptions added in v1.0.1

type V2RayWebsocketOptions struct {
	Path                string               `json:"path,omitempty"`
	Headers             badoption.HTTPHeader `json:"headers,omitempty"`
	MaxEarlyData        uint32               `json:"max_early_data,omitempty"`
	EarlyDataHeaderName string               `json:"early_data_header_name,omitempty"`
}

type VLESSInboundOptions added in v1.2.0

type VLESSInboundOptions struct {
	ListenOptions
	Users []VLESSUser `json:"users,omitempty"`
	InboundTLSOptionsContainer
	Multiplex *InboundMultiplexOptions `json:"multiplex,omitempty"`
	Transport *V2RayTransportOptions   `json:"transport,omitempty"`
}

type VLESSOutboundOptions added in v1.1.0

type VLESSOutboundOptions struct {
	DialerOptions
	ServerOptions
	UUID    string      `json:"uuid"`
	Flow    string      `json:"flow,omitempty"`
	Network NetworkList `json:"network,omitempty"`
	OutboundTLSOptionsContainer
	Multiplex      *OutboundMultiplexOptions `json:"multiplex,omitempty"`
	Transport      *V2RayTransportOptions    `json:"transport,omitempty"`
	PacketEncoding *string                   `json:"packet_encoding,omitempty"`
}

type VLESSUser added in v1.2.0

type VLESSUser struct {
	Name string `json:"name"`
	UUID string `json:"uuid"`
	Flow string `json:"flow,omitempty"`
}

type VMessInboundOptions

type VMessInboundOptions struct {
	ListenOptions
	Users []VMessUser `json:"users,omitempty"`
	InboundTLSOptionsContainer
	Multiplex *InboundMultiplexOptions `json:"multiplex,omitempty"`
	Transport *V2RayTransportOptions   `json:"transport,omitempty"`
}

type VMessOutboundOptions

type VMessOutboundOptions struct {
	DialerOptions
	ServerOptions
	UUID                string      `json:"uuid"`
	Security            string      `json:"security" enum:"auto,none,zero,aes-128-cfb,aes-128-gcm,chacha20-poly1305"`
	AlterId             int         `json:"alter_id,omitempty"`
	GlobalPadding       bool        `json:"global_padding,omitempty"`
	AuthenticatedLength bool        `json:"authenticated_length,omitempty"`
	Network             NetworkList `json:"network,omitempty"`
	OutboundTLSOptionsContainer
	PacketEncoding string                    `json:"packet_encoding,omitempty" enum:"packetaddr,xudp"`
	Multiplex      *OutboundMultiplexOptions `json:"multiplex,omitempty"`
	Transport      *V2RayTransportOptions    `json:"transport,omitempty"`
}

type VMessUser

type VMessUser struct {
	Name    string `json:"name"`
	UUID    string `json:"uuid"`
	AlterId int    `json:"alterId,omitempty"`
}

type WildcardSNI added in v1.11.10

type WildcardSNI int
const (
	ShadowTLSWildcardSNIOff WildcardSNI = iota
	ShadowTLSWildcardSNIAuthed
	ShadowTLSWildcardSNIAll
)

func (WildcardSNI) DescribeSchema added in v1.14.0

func (w WildcardSNI) DescribeSchema(builder schema.Builder) (*schema.Node, error)

func (WildcardSNI) MarshalJSON added in v1.11.10

func (w WildcardSNI) MarshalJSON() ([]byte, error)

func (WildcardSNI) String added in v1.11.10

func (w WildcardSNI) String() string

func (*WildcardSNI) UnmarshalJSON added in v1.11.10

func (w *WildcardSNI) UnmarshalJSON(bytes []byte) error

type WireGuardEndpointOptions added in v1.11.0

type WireGuardEndpointOptions struct {
	System       bool                             `json:"system,omitempty"`
	Name         string                           `json:"name,omitempty"`
	MTU          uint32                           `json:"mtu,omitempty"`
	Address      badoption.Listable[netip.Prefix] `json:"address"`
	PrivateKey   string                           `json:"private_key"`
	ListenPort   uint16                           `json:"listen_port,omitempty"`
	Peers        []WireGuardPeer                  `json:"peers,omitempty"`
	UDPTimeout   badoption.Duration               `json:"udp_timeout,omitempty"`
	UDPMapping   UDPNATBehavior                   `json:"udp_mapping,omitempty"`
	UDPFiltering UDPNATBehavior                   `json:"udp_filtering,omitempty"`
	UDPNATMax    uint32                           `json:"udp_nat_max,omitempty"`
	Workers      int                              `json:"workers,omitempty"`
	DialerOptions
}

type WireGuardPeer added in v1.3.0

type WireGuardPeer struct {
	Address                     string                           `json:"address,omitempty"`
	Port                        uint16                           `json:"port,omitempty"`
	PublicKey                   string                           `json:"public_key,omitempty"`
	PreSharedKey                string                           `json:"pre_shared_key,omitempty"`
	AllowedIPs                  badoption.Listable[netip.Prefix] `json:"allowed_ips,omitempty"`
	PersistentKeepaliveInterval uint16                           `json:"persistent_keepalive_interval,omitempty"`
	Reserved                    []uint8                          `json:"reserved,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL