Documentation
¶
Index ¶
- Variables
- func HttpLinkToHttpOption(link string) (*outbound.HttpOption, error)
- func Link2Dialer(link string) (outbound.Dialer, error)
- func ParseProxy(mapping map[string]interface{}, namePrefix string) (string, error)
- func RawConfigToVmessOption(config *RawConfig) (*outbound.VmessOption, error)
- func SSLinkToSSOption(link1 string) (*outbound.ShadowSocksOption, error)
- func SSRLinkToSSROption(link string) (*outbound.ShadowSocksROption, error)
- func ShadowrocketLinkToVmessLink(link string) (string, error)
- func ShadowrocketVmessLinkToVmessOptionIP(link string, resolveip bool) (*outbound.VmessOption, error)
- func ToVmessOption(path string) (*outbound.VmessOption, error)
- func TrojanLinkToTrojanOption(link string) (*outbound.TrojanOption, error)
- func VmessConfigToVmessOption(config *VmessConfig) (*outbound.VmessOption, error)
- func VmessLinkToVmessOption(link string) (*outbound.VmessOption, error)
- func VmessLinkToVmessOptionIP(link string, resolveip bool) (*outbound.VmessOption, error)
- type BaseProxy
- type ClashConfig
- type ClashRawConfig
- type Config
- type Controller
- type Experimental
- type FallbackFilter
- type General
- type Inbound
- type Outbound
- type Profile
- type RawConfig
- type RawFallbackFilter
- type Settings
- type StreamSettings
- type User
- type VNext
- type VmessConfig
- type VmessConfigMarshal
- type WSSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NotSSLink error = errors.New("not a shadowsocksR link")
)
View Source
var (
NotSSRLink error = errors.New("not a shadowsocksR link")
)
View Source
var RegShadowrocketVmess = regexp.MustCompile(`(?i)vmess://(\S+?)@(\S+?):([0-9]{2,5})/?([?#][^\s]+)`)
Functions ¶
func HttpLinkToHttpOption ¶
func HttpLinkToHttpOption(link string) (*outbound.HttpOption, error)
func ParseProxy ¶
func RawConfigToVmessOption ¶
func RawConfigToVmessOption(config *RawConfig) (*outbound.VmessOption, error)
func SSLinkToSSOption ¶
func SSLinkToSSOption(link1 string) (*outbound.ShadowSocksOption, error)
func SSRLinkToSSROption ¶
func SSRLinkToSSROption(link string) (*outbound.ShadowSocksROption, error)
func ShadowrocketVmessLinkToVmessOptionIP ¶
func ShadowrocketVmessLinkToVmessOptionIP(link string, resolveip bool) (*outbound.VmessOption, error)
parse shadowrocket link
func ToVmessOption ¶
func ToVmessOption(path string) (*outbound.VmessOption, error)
func TrojanLinkToTrojanOption ¶
func TrojanLinkToTrojanOption(link string) (*outbound.TrojanOption, error)
TODO: SkipCertVerify
func VmessConfigToVmessOption ¶
func VmessConfigToVmessOption(config *VmessConfig) (*outbound.VmessOption, error)
func VmessLinkToVmessOption ¶
func VmessLinkToVmessOption(link string) (*outbound.VmessOption, error)
func VmessLinkToVmessOptionIP ¶
func VmessLinkToVmessOptionIP(link string, resolveip bool) (*outbound.VmessOption, error)
TODO: safe base64
Types ¶
type BaseProxy ¶
type BaseProxy struct { Name string `yaml:"name"` Server string `yaml:"server"` Port interface{} `yaml:"port"` // int, string Type string `yaml:"type"` }
func ParseBaseProxy ¶
type ClashConfig ¶
type ClashConfig struct { General *General Experimental *Experimental Profile *Profile Proxies []string }
Config is clash config manager
func ParseRawConfig ¶
func ParseRawConfig(rawCfg *ClashRawConfig) (*ClashConfig, error)
type ClashRawConfig ¶
type ClashRawConfig struct { Port int `yaml:"port"` SocksPort int `yaml:"socks-port"` RedirPort int `yaml:"redir-port"` TProxyPort int `yaml:"tproxy-port"` MixedPort int `yaml:"mixed-port"` Authentication []string `yaml:"authentication"` AllowLan bool `yaml:"allow-lan"` BindAddress string `yaml:"bind-address"` Mode string `yaml:"mode"` LogLevel string `yaml:"log-level"` NamePrefix string `yaml:"name-prefix"` IPv6 bool `yaml:"ipv6"` ExternalController string `yaml:"external-controller"` ExternalUI string `yaml:"external-ui"` Secret string `yaml:"secret"` Interface string `yaml:"interface-name"` ProxyProvider map[string]map[string]interface{} `yaml:"proxy-providers"` Hosts map[string]string `yaml:"hosts"` Experimental Experimental `yaml:"experimental"` Profile Profile `yaml:"profile"` Proxy []map[string]interface{} `yaml:"proxies"` }
func UnmarshalRawConfig ¶
func UnmarshalRawConfig(buf []byte) (*ClashRawConfig, error)
type Config ¶
type Config struct { Protocol string Remarks string Server string Net string // vmess net type Port int Password string SNI string }
func Link2Config ¶
type Controller ¶
type Controller struct { ExternalController string `json:"-"` ExternalUI string `json:"-"` Secret string `json:"-"` }
Controller
type FallbackFilter ¶
type FallbackFilter struct { GeoIP bool `yaml:"geoip"` IPCIDR []*net.IPNet `yaml:"ipcidr"` Domain []string `yaml:"domain"` }
FallbackFilter config
type General ¶
type General struct { Inbound Controller Mode string `json:"mode"` LogLevel string `json:"log-level"` IPv6 bool `json:"ipv6"` Interface string `json:"-"` }
General config
type Inbound ¶
type Inbound struct { Port int `json:"port"` SocksPort int `json:"socks-port"` RedirPort int `json:"redir-port"` TProxyPort int `json:"tproxy-port"` MixedPort int `json:"mixed-port"` Authentication []string `json:"authentication"` AllowLan bool `json:"allow-lan"` BindAddress string `json:"bind-address"` }
Inbound
type Outbound ¶
type Outbound struct { Protocol string `json:"protocol"` Description string `json:"description"` Settings Settings `json:"settings"` StreamSettings *StreamSettings `json:"streamSettings,omitempty"` }
type RawFallbackFilter ¶
type StreamSettings ¶
type StreamSettings struct { Network string `json:"network"` Security string `json:"security"` WSSettings WSSettings `json:"wsSettings,omitempty"` }
type VmessConfig ¶
type VmessConfig struct { Add string `json:"add"` Aid json.RawMessage `json:"aid"` AlterId json.RawMessage `json:"alterId,omitempty"` Host string `json:"host"` ID string `json:"id"` Net string `json:"net"` Path string `json:"path"` Port json.RawMessage `json:"port"` Ps string `json:"ps"` TLSRaw json.RawMessage `json:"tls"` Type string `json:"type"` V json.RawMessage `json:"v,omitempty"` Security string `json:"security,omitempty"` Scy string `json:"scy,omitempty"` Encryption string `json:"encryption,omitempty"` ResolveIP bool `json:"resolve_ip,omitempty"` SkipCertVerify bool `json:"skip-cert-verify,omitempty"` ServerName string `json:"sni,omitempty"` PortInt int `json:"-"` AidInt int `json:"-"` TLS string `json:"-"` }
func ShadowrocketVmessLinkToVmessConfig ¶
func ShadowrocketVmessLinkToVmessConfig(link string, resolveip bool) (*VmessConfig, error)
func VmessLinkToVmessConfig ¶
func VmessLinkToVmessConfig(link string, resolveip bool) (*VmessConfig, error)
func VmessLinkToVmessConfigIP ¶
func VmessLinkToVmessConfigIP(link string, resolveip bool) (*VmessConfig, error)
type VmessConfigMarshal ¶
type VmessConfigMarshal struct { Add string `json:"add"` Aid int `json:"aid"` Host string `json:"host"` ID string `json:"id"` Net string `json:"net"` Path string `json:"path"` Port uint16 `json:"port"` Ps string `json:"ps"` TLS string `json:"tls"` Type string `json:"type"` V string `json:"v,omitempty"` Security string `json:"security,omitempty"` Scy string `json:"scy,omitempty"` ResolveIP bool `json:"resolve_ip,omitempty"` SkipCertVerify bool `json:"skip-cert-verify"` ServerName string `json:"sni"` }
type WSSettings ¶
type WSSettings struct {
Path string `json:"path"`
}
Click to show internal directories.
Click to hide internal directories.