Documentation
¶
Index ¶
- func DecodeBase64(encoded string) (string, error)
- func ParseAnytls(link string) (*configs.OutboundHandlerConfig, error)
- func ParseHysteriaFromLink(link string) (*configs.OutboundHandlerConfig, error)
- func ParseSocks5FromLink(link string) (*configs.OutboundHandlerConfig, error)
- func ParseSsFromLink(link string) (*configs.OutboundHandlerConfig, error)
- func ParseTrojan(link string) (*configs.OutboundHandlerConfig, error)
- func ParseVlessFromLink(link string) (*configs.OutboundHandlerConfig, error)
- func TryParsePorts(ports string) []*mynet.PortRange
- type DecodeResult
- type SsConfig
- type VmessConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64 ¶
DecodeBase64 decodes a base64 string, trying both standard and URL-safe encoding and adding padding if necessary
func ParseAnytls ¶
func ParseAnytls(link string) (*configs.OutboundHandlerConfig, error)
func ParseHysteriaFromLink ¶
func ParseHysteriaFromLink(link string) (*configs.OutboundHandlerConfig, error)
TODO: pinSHA256 hysteria2://letmein@example.com:123,5000-6000/?insecure=1&obfs= salamander&obfs-password=gawrgura&pinSHA256=deadbeef&sni=real.example.com
func ParseSocks5FromLink ¶
func ParseSocks5FromLink(link string) (*configs.OutboundHandlerConfig, error)
func ParseSsFromLink ¶
func ParseSsFromLink(link string) (*configs.OutboundHandlerConfig, error)
ParseSsFromLink parses a Shadowsocks configuration from a URI link
func ParseTrojan ¶
func ParseTrojan(link string) (*configs.OutboundHandlerConfig, error)
func ParseVlessFromLink ¶
func ParseVlessFromLink(link string) (*configs.OutboundHandlerConfig, error)
func TryParsePorts ¶
TryParsePorts parses a string of ports in format "123,5000-6000" Returns a non-empty slice of PortRange if ports is valid, otherwise returns nil
Types ¶
type DecodeResult ¶
type DecodeResult struct {
Configs []*configs.OutboundHandlerConfig
Description string
FailedNodes []string
}
func Decode ¶
func Decode(content string) (*DecodeResult, error)
Decode parses subscription content into outbound handler configurations
type SsConfig ¶
SsConfig represents a Shadowsocks configuration
func ParseSsFromLink0 ¶
ParseSsFromLink parses a Shadowsocks configuration from a URI link
type VmessConfig ¶
type VmessConfig struct {
V string `json:"v,omitempty"`
PS string `json:"ps,omitempty"`
Add string `json:"add"`
Port json.Number `json:"port"`
ID string `json:"id,omitempty"`
Aid json.Number `json:"aid,omitempty"`
Scy string `json:"scy,omitempty"`
Net string `json:"net,omitempty"`
Type string `json:"type,omitempty"`
Host string `json:"host,omitempty"`
Path string `json:"path,omitempty"`
TLS string `json:"tls,omitempty"`
SNI string `json:"sni,omitempty"`
ALPN string `json:"alpn,omitempty"`
FP string `json:"fp,omitempty"`
}
VmessConfig represents a Vmess protocol configuration
func ParseVmessFromJSON ¶
func ParseVmessFromJSON(data []byte) (*VmessConfig, error)
ParseVmessFromJSON parses a VmessConfig from JSON
func (*VmessConfig) ToProxyHandlerConfig ¶
func (v *VmessConfig) ToProxyHandlerConfig() (*configs.OutboundHandlerConfig, error)
ToProxyHandlerConfig converts VmessConfig to OutboundHandlerConfig