|
@@ -3,6 +3,8 @@ package provider
|
|
import (
|
|
import (
|
|
"strings"
|
|
"strings"
|
|
|
|
|
|
|
|
+ "github.com/zu1k/proxypool/pkg/tool"
|
|
|
|
+
|
|
"github.com/zu1k/proxypool/pkg/proxy"
|
|
"github.com/zu1k/proxypool/pkg/proxy"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -37,17 +39,17 @@ func checkClashSupport(p proxy.Proxy) bool {
|
|
switch p.TypeName() {
|
|
switch p.TypeName() {
|
|
case "ssr":
|
|
case "ssr":
|
|
ssr := p.(*proxy.ShadowsocksR)
|
|
ssr := p.(*proxy.ShadowsocksR)
|
|
- if checkInList(ssrCipherList, ssr.Cipher) && checkInList(ssrProtocolList, ssr.Protocol) && checkInList(ssrObfsList, ssr.Obfs) {
|
|
|
|
|
|
+ if tool.CheckInList(proxy.SSRCipherList, ssr.Cipher) && tool.CheckInList(ssrProtocolList, ssr.Protocol) && tool.CheckInList(ssrObfsList, ssr.Obfs) {
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
case "vmess":
|
|
case "vmess":
|
|
vmess := p.(*proxy.Vmess)
|
|
vmess := p.(*proxy.Vmess)
|
|
- if checkInList(vmessCipherList, vmess.Cipher) {
|
|
|
|
|
|
+ if tool.CheckInList(vmessCipherList, vmess.Cipher) {
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
case "ss":
|
|
case "ss":
|
|
ss := p.(*proxy.Shadowsocks)
|
|
ss := p.(*proxy.Shadowsocks)
|
|
- if checkInList(ssCipherList, ss.Cipher) {
|
|
|
|
|
|
+ if tool.CheckInList(proxy.SSCipherList, ss.Cipher) {
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
case "trojan":
|
|
case "trojan":
|
|
@@ -58,30 +60,6 @@ func checkClashSupport(p proxy.Proxy) bool {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
|
|
-var ssrCipherList = []string{
|
|
|
|
- "aes-128-cfb",
|
|
|
|
- "aes-192-cfb",
|
|
|
|
- "aes-256-cfb",
|
|
|
|
- "aes-128-ctr",
|
|
|
|
- "aes-192-ctr",
|
|
|
|
- "aes-256-ctr",
|
|
|
|
- "aes-128-ofb",
|
|
|
|
- "aes-192-ofb",
|
|
|
|
- "aes-256-ofb",
|
|
|
|
- "des-cfb",
|
|
|
|
- "bf-cfb",
|
|
|
|
- "cast5-cfb",
|
|
|
|
- "rc4-md5",
|
|
|
|
- "chacha20-ietf",
|
|
|
|
- "salsa20",
|
|
|
|
- "camellia-128-cfb",
|
|
|
|
- "camellia-192-cfb",
|
|
|
|
- "camellia-256-cfb",
|
|
|
|
- "idea-cfb",
|
|
|
|
- "rc2-cfb",
|
|
|
|
- "seed-cfb",
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
var ssrObfsList = []string{
|
|
var ssrObfsList = []string{
|
|
"plain",
|
|
"plain",
|
|
"http_simple",
|
|
"http_simple",
|
|
@@ -110,20 +88,3 @@ var vmessCipherList = []string{
|
|
"chacha20-poly1305",
|
|
"chacha20-poly1305",
|
|
"none",
|
|
"none",
|
|
}
|
|
}
|
|
-
|
|
|
|
-var ssCipherList = []string{
|
|
|
|
- "aes-128-gcm",
|
|
|
|
- "aes-192-gcm",
|
|
|
|
- "aes-256-gcm",
|
|
|
|
- "aes-128-cfb",
|
|
|
|
- "aes-192-cfb",
|
|
|
|
- "aes-256-cfb",
|
|
|
|
- "aes-128-ctr",
|
|
|
|
- "aes-192-ctr",
|
|
|
|
- "aes-256-ctr",
|
|
|
|
- "rc4-md5",
|
|
|
|
- "chacha20-ietf",
|
|
|
|
- "xchacha20",
|
|
|
|
- "chacha20-ietf-poly1305",
|
|
|
|
- "xchacha20-ietf-poly1305",
|
|
|
|
-}
|
|
|