Documentation
¶
Index ¶
- Constants
- func BuildSingbox(adapter proxy.Adapter, uuid string) ([]byte, error)
- type AnyTLSOutboundOptions
- type BrutalOptions
- type Duration
- type HTTPHeader
- type Hysteria2Obfs
- type Hysteria2OutboundOptions
- type Listable
- type OutboundECHOptions
- type OutboundMultiplexOptions
- type OutboundOptions
- type OutboundRealityOptions
- type OutboundTLSOptions
- type OutboundTLSOptionsContainer
- type OutboundUTLSOptions
- type Proxy
- func ParseAnyTLS(data proxy.Proxy, password string) (*Proxy, error)
- func ParseHysteria2(data proxy.Proxy, password string) (*Proxy, error)
- func ParseShadowsocks(data proxy.Proxy, uuid string) (*Proxy, error)
- func ParseTUIC(data proxy.Proxy, uuid string) (*Proxy, error)
- func ParseTrojan(data proxy.Proxy, uuid string) (*Proxy, error)
- func ParseVMess(data proxy.Proxy, uuid string) (*Proxy, error)
- func ParseVless(data proxy.Proxy, uuid string) (*Proxy, error)
- type RouteOptions
- type Rule
- type RuleSet
- type SelectorOutboundOptions
- type ServerOptions
- type ShadowsocksOptions
- type TUICOutboundOptions
- type TrojanOutboundOptions
- type URLTestOutboundOptions
- type V2RayGRPCOptions
- type V2RayHTTPOptions
- type V2RayHTTPUpgradeOptions
- type V2RayQUICOptions
- type V2RayTransportOptions
- type V2RayWebsocketOptions
- type VLESSOutboundOptions
- type VMessOutboundOptions
Constants ¶
View Source
const ( Trojan = "trojan" VLESS = "vless" VMess = "vmess" TUIC = "tuic" Hysteria2 = "hysteria2" AnyTLS = "anytls" Shadowsocks = "shadowsocks" Selector = "selector" URLTest = "urltest" Direct = "direct" Block = "block" DNS = "dns" )
View Source
const DefaultTemplate = `` /* 1947-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnyTLSOutboundOptions ¶ added in v1.0.2
type AnyTLSOutboundOptions struct {
ServerOptions
OutboundTLSOptionsContainer
Password string `json:"password,omitempty"`
}
type BrutalOptions ¶
type HTTPHeader ¶
type Hysteria2Obfs ¶
type Hysteria2OutboundOptions ¶
type Hysteria2OutboundOptions struct {
ServerOptions
ServerPorts []string `json:"server_ports,omitempty"`
HopInterval int `json:"hop_interval,omitempty"`
UpMbps int `json:"up_mbps,omitempty"`
DownMbps int `json:"down_mbps,omitempty"`
Obfs *Hysteria2Obfs `json:"obfs,omitempty"`
Password string `json:"password,omitempty"`
Network string `json:"network,omitempty"`
OutboundTLSOptionsContainer
Multiplex *OutboundMultiplexOptions `json:"multiplex,omitempty"`
Transport *V2RayTransportOptions `json:"transport,omitempty"`
}
type OutboundECHOptions ¶
type OutboundECHOptions struct {
Enabled bool `json:"enabled,omitempty"`
PQSignatureSchemesEnabled bool `json:"pq_signature_schemes_enabled,omitempty"`
DynamicRecordSizingDisabled bool `json:"dynamic_record_sizing_disabled,omitempty"`
Config Listable[string] `json:"config,omitempty"`
ConfigPath string `json:"config_path,omitempty"`
}
type OutboundMultiplexOptions ¶
type OutboundMultiplexOptions struct {
Enabled bool `json:"enabled,omitempty"`
Protocol string `json:"protocol,omitempty"`
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 OutboundOptions ¶
type OutboundRealityOptions ¶
type OutboundTLSOptions ¶
type OutboundTLSOptions struct {
Enabled bool `json:"enabled,omitempty"`
DisableSNI bool `json:"disable_sni,omitempty"`
ServerName string `json:"server_name,omitempty"`
Insecure bool `json:"insecure,omitempty"`
ALPN Listable[string] `json:"alpn,omitempty"`
MinVersion string `json:"min_version,omitempty"`
MaxVersion string `json:"max_version,omitempty"`
CipherSuites Listable[string] `json:"cipher_suites,omitempty"`
Certificate Listable[string] `json:"certificate,omitempty"`
CertificatePath string `json:"certificate_path,omitempty"`
ECH *OutboundECHOptions `json:"ech,omitempty"`
UTLS *OutboundUTLSOptions `json:"utls,omitempty"`
Reality *OutboundRealityOptions `json:"reality,omitempty"`
}
func NewOutboundTLSOptions ¶
func NewOutboundTLSOptions(security string, cfg proxy.SecurityConfig) *OutboundTLSOptions
type OutboundTLSOptionsContainer ¶
type OutboundTLSOptionsContainer struct {
TLS *OutboundTLSOptions `json:"tls,omitempty"`
}
type OutboundUTLSOptions ¶
type Proxy ¶
type Proxy struct {
Tag string `json:"tag,omitempty"`
Type string `json:"type"`
ShadowsocksOptions *ShadowsocksOptions `json:"-"`
TUICOptions *TUICOutboundOptions `json:"-"`
TrojanOptions *TrojanOutboundOptions `json:"-"`
VLESSOptions *VLESSOutboundOptions `json:"-"`
VMessOptions *VMessOutboundOptions `json:"-"`
AnyTLSOptions *AnyTLSOutboundOptions `json:"-"`
Hysteria2Options *Hysteria2OutboundOptions `json:"-"`
SelectorOptions *SelectorOutboundOptions `json:"-"`
URLTestOptions *URLTestOutboundOptions `json:"-"`
}
func ParseAnyTLS ¶ added in v1.0.2
func (Proxy) MarshalJSON ¶
type RouteOptions ¶
type Rule ¶
type Rule struct {
Outbound string `json:"outbound,omitempty"`
ClashMode string `json:"clash_mode,omitempty"`
RuleSet []string `json:"rule_set,omitempty"`
Domain []string `json:"domain,omitempty"`
DomainSuffix []string `json:"domain_suffix,omitempty"`
DomainKeyword []string `json:"domain_keyword,omitempty"`
DomainRegex []string `json:"domain_regex,omitempty"`
GeoIP []string `json:"geoip,omitempty"`
IPCIDR []string `json:"ip_cidr,omitempty"`
IPIsPrivate bool `json:"ip_is_private,omitempty"`
SourceIPCIDR []string `json:"source_ip_cidr,omitempty"`
ProcessName []string `json:"process_name,omitempty"`
ProcessPath []string `json:"process_path,omitempty"`
SourcePort []uint16 `json:"source_port,omitempty"`
Protocol []string `json:"protocol,omitempty"`
Port []uint16 `json:"port,omitempty"`
Action string `json:"action,omitempty"`
Inbound []string `json:"inbound,omitempty"`
Rules []Rule `json:"rules,omitempty"`
Type string `json:"type,omitempty"`
Mode string `json:"mode,omitempty"`
}
type SelectorOutboundOptions ¶
type SelectorOutboundOptions struct {
OutboundOptions
Outbounds []string `json:"outbounds"`
Default string `json:"default,omitempty"`
InterruptExistConnections bool `json:"interrupt_exist_connections,omitempty"`
}
type ServerOptions ¶
type ShadowsocksOptions ¶
type TUICOutboundOptions ¶
type TUICOutboundOptions struct {
ServerOptions
UUID string `json:"uuid,omitempty"`
Password string `json:"password,omitempty"`
CongestionControl string `json:"congestion_control,omitempty"`
UDPRelayMode string `json:"udp_relay_mode,omitempty"`
UDPOverStream bool `json:"udp_over_stream,omitempty"`
ZeroRTTHandshake bool `json:"zero_rtt_handshake,omitempty"`
Heartbeat string `json:"heartbeat,omitempty"`
Network string `json:"network,omitempty"`
OutboundTLSOptionsContainer
}
type TrojanOutboundOptions ¶
type TrojanOutboundOptions struct {
ServerOptions
Password string `json:"password"`
Network string `json:"network,omitempty"`
OutboundTLSOptionsContainer
Multiplex *OutboundMultiplexOptions `json:"multiplex,omitempty"`
Transport *V2RayTransportOptions `json:"transport,omitempty"`
}
type URLTestOutboundOptions ¶
type URLTestOutboundOptions struct {
OutboundOptions
Outbounds []string `json:"outbounds"`
URL string `json:"url,omitempty"`
Interval Duration `json:"interval,omitempty"`
Tolerance uint16 `json:"tolerance,omitempty"`
IdleTimeout Duration `json:"idle_timeout,omitempty"`
InterruptExistConnections bool `json:"interrupt_exist_connections,omitempty"`
}
type V2RayGRPCOptions ¶
type V2RayHTTPOptions ¶
type V2RayHTTPOptions struct {
Host Listable[string] `json:"host,omitempty"`
Path string `json:"path,omitempty"`
Method string `json:"method,omitempty"`
Headers HTTPHeader `json:"headers,omitempty"`
IdleTimeout Duration `json:"idle_timeout,omitempty"`
PingTimeout Duration `json:"ping_timeout,omitempty"`
}
type V2RayHTTPUpgradeOptions ¶
type V2RayHTTPUpgradeOptions struct {
Host string `json:"host,omitempty"`
Path string `json:"path,omitempty"`
Headers HTTPHeader `json:"headers,omitempty"`
}
type V2RayQUICOptions ¶
type V2RayQUICOptions struct{}
type V2RayTransportOptions ¶
type V2RayTransportOptions struct {
Type string `json:"type"`
HTTPOptions V2RayHTTPOptions `json:"-"`
WebsocketOptions V2RayWebsocketOptions `json:"-"`
QUICOptions V2RayQUICOptions `json:"-"`
GRPCOptions V2RayGRPCOptions `json:"-"`
HTTPUpgradeOptions V2RayHTTPUpgradeOptions `json:"-"`
}
func NewV2RayTransportOptions ¶
func NewV2RayTransportOptions(network string, transport proxy.TransportConfig) *V2RayTransportOptions
func (V2RayTransportOptions) MarshalJSON ¶
func (v V2RayTransportOptions) MarshalJSON() ([]byte, error)
type V2RayWebsocketOptions ¶
type V2RayWebsocketOptions struct {
Path string `json:"path,omitempty"`
Headers HTTPHeader `json:"headers,omitempty"`
MaxEarlyData uint32 `json:"max_early_data,omitempty"`
EarlyDataHeaderName string `json:"early_data_header_name,omitempty"`
}
type VLESSOutboundOptions ¶
type VLESSOutboundOptions struct {
ServerOptions
OutboundTLSOptionsContainer
UUID string `json:"uuid"`
Flow string `json:"flow,omitempty"`
Network string `json:"network,omitempty"`
Multiplex *OutboundMultiplexOptions `json:"multiplex,omitempty"`
Transport *V2RayTransportOptions `json:"transport,omitempty"`
PacketEncoding *string `json:"packet_encoding,omitempty"`
}
type VMessOutboundOptions ¶
type VMessOutboundOptions struct {
ServerOptions
UUID string `json:"uuid"`
Security string `json:"security"`
AlterId int `json:"alter_id,omitempty"`
GlobalPadding bool `json:"global_padding,omitempty"`
AuthenticatedLength bool `json:"authenticated_length,omitempty"`
Network string `json:"network,omitempty"`
PacketEncoding string `json:"packet_encoding,omitempty"`
Multiplex *OutboundMultiplexOptions `json:"multiplex,omitempty"`
Transport *V2RayTransportOptions `json:"transport,omitempty"`
OutboundTLSOptionsContainer
}
Click to show internal directories.
Click to hide internal directories.