mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-07-06 21:02:34 +08:00
u
This commit is contained in:
@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type ProxyParser interface {
|
||||
Parse(proxy string) (P.Proxy, error)
|
||||
Parse(config ParseConfig, proxy string) (P.Proxy, error)
|
||||
GetPrefixes() []string
|
||||
GetType() string
|
||||
SupportClash() bool
|
||||
@ -64,7 +64,7 @@ func GetAllPrefixes() []string {
|
||||
return prefixes
|
||||
}
|
||||
|
||||
func ParseProxyWithRegistry(proxy string) (P.Proxy, error) {
|
||||
func ParseProxyWithRegistry(config ParseConfig, proxy string) (P.Proxy, error) {
|
||||
proxy = strings.TrimSpace(proxy)
|
||||
if proxy == "" {
|
||||
return P.Proxy{}, fmt.Errorf("%w: %s", ErrInvalidStruct, "empty proxy string")
|
||||
@ -72,7 +72,7 @@ func ParseProxyWithRegistry(proxy string) (P.Proxy, error) {
|
||||
|
||||
for prefix, parser := range registry.parsers {
|
||||
if strings.HasPrefix(proxy, prefix) {
|
||||
return parser.Parse(proxy)
|
||||
return parser.Parse(config, proxy)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user