mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-06-17 20:53:18 +08:00
modify ProxyParser interface
This commit is contained in:
@ -11,6 +11,14 @@ import (
|
||||
|
||||
type AnytlsParser struct{}
|
||||
|
||||
func (p *AnytlsParser) SupportClash() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *AnytlsParser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *AnytlsParser) GetPrefixes() []string {
|
||||
return []string{"anytls://"}
|
||||
}
|
||||
|
@ -12,6 +12,14 @@ import (
|
||||
|
||||
type HysteriaParser struct{}
|
||||
|
||||
func (p *HysteriaParser) SupportClash() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *HysteriaParser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *HysteriaParser) GetPrefixes() []string {
|
||||
return []string{"hysteria://"}
|
||||
}
|
||||
|
@ -11,6 +11,14 @@ import (
|
||||
|
||||
type Hysteria2Parser struct{}
|
||||
|
||||
func (p *Hysteria2Parser) SupportClash() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *Hysteria2Parser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *Hysteria2Parser) GetPrefixes() []string {
|
||||
return []string{"hysteria2://", "hy2://"}
|
||||
}
|
||||
|
@ -16,6 +16,8 @@ type ProxyParser interface {
|
||||
GetPrefixes() []string
|
||||
// GetType 返回协议类型名称
|
||||
GetType() string
|
||||
SupportClash() bool
|
||||
SupportMeta() bool
|
||||
}
|
||||
|
||||
// parserRegistry 解析器注册中心
|
||||
|
@ -12,6 +12,14 @@ import (
|
||||
// ShadowsocksParser Shadowsocks协议解析器
|
||||
type ShadowsocksParser struct{}
|
||||
|
||||
func (p *ShadowsocksParser) SupportClash() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *ShadowsocksParser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// GetPrefixes 返回支持的协议前缀
|
||||
func (p *ShadowsocksParser) GetPrefixes() []string {
|
||||
return []string{"ss://"}
|
||||
|
@ -11,6 +11,14 @@ import (
|
||||
|
||||
type ShadowsocksRParser struct{}
|
||||
|
||||
func (p *ShadowsocksRParser) SupportClash() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *ShadowsocksRParser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *ShadowsocksRParser) GetPrefixes() []string {
|
||||
return []string{"ssr://"}
|
||||
}
|
||||
|
@ -11,6 +11,13 @@ import (
|
||||
|
||||
type SocksParser struct{}
|
||||
|
||||
func (p *SocksParser) SupportClash() bool {
|
||||
return true
|
||||
}
|
||||
func (p *SocksParser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *SocksParser) GetPrefixes() []string {
|
||||
return []string{"socks://"}
|
||||
}
|
||||
|
@ -11,6 +11,14 @@ import (
|
||||
|
||||
type TrojanParser struct{}
|
||||
|
||||
func (p *TrojanParser) SupportClash() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *TrojanParser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *TrojanParser) GetPrefixes() []string {
|
||||
return []string{"trojan://"}
|
||||
}
|
||||
|
@ -11,6 +11,14 @@ import (
|
||||
|
||||
type VlessParser struct{}
|
||||
|
||||
func (p *VlessParser) SupportClash() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *VlessParser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *VlessParser) GetPrefixes() []string {
|
||||
return []string{"vless://"}
|
||||
}
|
||||
|
@ -12,6 +12,14 @@ import (
|
||||
|
||||
type VmessParser struct{}
|
||||
|
||||
func (p *VmessParser) SupportClash() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *VmessParser) SupportMeta() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *VmessParser) GetPrefixes() []string {
|
||||
return []string{"vmess://"}
|
||||
}
|
||||
|
Reference in New Issue
Block a user