Documentation
¶
Index ¶
- Constants
- Variables
- func ParseProxyToClash(content string) (string, error)
- type Base
- func (b *Base) AddToName(name string)
- func (b *Base) BaseInfo() *Base
- func (b *Base) Clone() Base
- func (b *Base) GetCountry() string
- func (b *Base) GetServer() string
- func (b *Base) GetUrl() string
- func (b *Base) SetCountry(country string)
- func (b *Base) SetEmoji(emoji string)
- func (b *Base) SetIP(ip string)
- func (b *Base) SetName(name string)
- func (b *Base) SetUseable(useable bool)
- func (b *Base) TypeName() string
- type Clash
- type ClashRSSR
- type ClashSS
- type ClashVmess
- type HTTP2Options
- type HTTPOptions
- type Http
- type PluginOpts
- type Proxy
- type SSD
- type Socket
- type Trojan
- type Vmess
Constants ¶
View Source
const ( SSRServer = iota SSRPort SSRProtocol SSRCipher SSROBFS SSRSuffix )
Variables ¶
View Source
var ( ErrorNotVmessLink = errors.New("not a correct vmess link") ErrorVmessPayloadParseFail = errors.New("vmess link payload parse failed") )
View Source
var ( // ErrorNotSSLink is an error type ErrorNotSSLink = errors.New("not a correct ss link") )
View Source
var (
ErrorNotSSRLink = errors.New("not a correct ssr link")
)
View Source
var (
ErrorNotTrojanink = errors.New("not a correct trojan link")
)
Functions ¶
func ParseProxyToClash ¶
Types ¶
type Base ¶
type Base struct {
Name string `yaml:"name" json:"name,omitempty"`
Server string `yaml:"server" json:"server,omitempty"`
Path string `yaml:"path" json:"path,omitempty,omitempty"`
Type string `yaml:"type" json:"type,omitempty"`
Country string `yaml:"country,omitempty" json:"country,omitempty"`
Emoji string `yaml:"emoji" json:"emoji,omitempty"`
Port interface{} `yaml:"port" json:"port,omitempty" `
UDP bool `yaml:"udp,omitempty" json:"udp,omitempty"`
Useable bool `yaml:"useable,omitempty" json:"useable,omitempty"`
}
Base implements interface Proxy. It's the basic proxy struct. Vmess etc extends Base
func (*Base) GetCountry ¶
func (*Base) SetCountry ¶
func (*Base) SetUseable ¶
type Clash ¶
type Clash struct {
Port int `yaml:"port"`
SocksPort int `yaml:"socks-port"`
// RedirPort int `yaml:"redir-port"`
// Authentication []string `yaml:"authentication"`
AllowLan bool `yaml:"allow-lan"`
Mode string `yaml:"mode"`
LogLevel string `yaml:"log-level"`
ExternalController string `yaml:"external-controller"`
// ExternalUI string `yaml:"external-ui"`
// Secret string `yaml:"secret"`
// Experimental map[string]interface{} `yaml:"experimental"`
Proxy []map[string]interface{} `yaml:"proxies"`
ProxyGroup []map[string]interface{} `yaml:"proxy-groups"`
Rule []string `yaml:"rules"`
CFWByPass []string `yaml:"cfw-bypass"`
CFWLatencyTimeout int `yaml:"cfw-latency-timeout"`
}
type ClashRSSR ¶
type ClashRSSR struct {
Base
Password string `json:"password"`
Cipher string `json:"cipher"`
Protocol string `json:"protocol"`
ProtocolParam string `json:"protocol-param"`
OBFS string `json:"obfs"`
OBFSParam string `json:"obfs-param"`
}
func ParseSSRLink ¶
func (ClashRSSR) Link ¶
https://github.com/HMBSbige/ClashRSSR-Windows/wiki/SSR-QRcode-scheme
type ClashSS ¶
type ClashSS struct {
Base
Password string `json:"password"`
Cipher string `json:"cipher"`
Plugin string `json:"plugin"`
PluginOpts PluginOpts `json:"plugin-opts"`
}
func ParseSSLink ¶
ParseSSLink ParseSSLink() parses an ss link to ss proxy
func (ClashSS) Link ¶
Link https://shadowsocks.org/en/config/quick-guide.html Link converts a ss proxy to string
type ClashVmess ¶
type ClashVmess struct {
Base
UUID string `json:"uuid,omitempty"`
AlterID interface{} `json:"alterId,omitempty"`
Cipher string `json:"cipher,omitempty"`
TLS bool `json:"tls,omitempty"`
Network string `json:"network,omitempty"`
WSPATH string `json:"ws-path,omitempty"`
WSHeaders map[string]string `json:"ws-headers,omitempty"`
SkipCertVerify bool `json:"skip-cert-verify,omitempty"`
HTTPOpts *HTTPOptions `yaml:"http-opts,omitempty" json:"http-opts,omitempty"`
HTTP2Opts *HTTP2Options `yaml:"h2-opts,omitempty" json:"h2-opts,omitempty"`
ServerName string `yaml:"servername,omitempty" json:"servername,omitempty"`
}
func ParseVmessLink ¶
func ParseVmessLink(link string) (*ClashVmess, error)
func (ClashVmess) Clone ¶
func (v ClashVmess) Clone() Proxy
func (ClashVmess) Link ¶
func (v ClashVmess) Link() (link string)
func (ClashVmess) String ¶
func (v ClashVmess) String() string
func (ClashVmess) ToClash ¶
func (v ClashVmess) ToClash() string
func (ClashVmess) ToSurge ¶
func (v ClashVmess) ToSurge() string
type HTTP2Options ¶
type HTTPOptions ¶
type Http ¶
type Http struct {
Base
Username string `json:"username"`
Password string `json:"password"`
Tls bool `json:"tls"`
}
func ParseHttpLink ¶
func ParseSocketLink ¶
type PluginOpts ¶
type Proxy ¶
type Proxy interface {
String() string
ToClash() string
ToSurge() string
Link() string
SetName(name string)
AddToName(name string)
SetIP(ip string)
TypeName() string //ss ssr vmess trojan
BaseInfo() *Base
Clone() Proxy
SetUseable(useable bool)
SetCountry(country string)
GetCountry() string
SetEmoji(emoji string)
}
func ParseProxy ¶
type SSD ¶
type SSD struct {
Airport string `json:"airport"`
Port int `json:"port"`
Encryption string `json:"encryption"`
Password string `json:"password"`
TrafficUsed float64 `json:"traffic_used"`
TrafficTotal float64 `json:"traffic_total"`
Expiry string `json:"expiry"`
URL string `json:"url"`
Servers []struct {
ID int `json:"id"`
Server string `json:"server"`
Ratio float64 `json:"ratio"`
Remarks string `json:"remarks"`
Port string `json:"port"`
Encryption string `json:"encryption"`
Password string `json:"password"`
Plugin string `json:"plugin"`
PluginOptions string `json:"plugin_options"`
} `json:"servers"`
}
type Trojan ¶
type Trojan struct {
Base
Password string `json:"password"`
Sni string `json:"sni,omitempty"`
ALPN []string `yaml:"alpn,omitempty" json:"alpn,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty" json:"skip-cert-verify,omitempty"`
}
func ParseTrojanLink ¶
type Vmess ¶
type Vmess struct {
Add string `json:"add"`
Aid interface{} `json:"aid"`
Host string `json:"host"`
ID string `json:"id"`
Net string `json:"net"`
Path string `json:"path"`
Port interface{} `json:"port"`
PS string `json:"ps"`
TLS string `json:"tls"`
Type string `json:"type"`
V interface{} `json:"v"`
}
Click to show internal directories.
Click to hide internal directories.