mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-20 00:50:06 +08:00
Merge 36ffea8db7 into 17966b5418
This commit is contained in:
commit
446b1fa1f5
@ -430,7 +430,7 @@ type RawConfig struct {
|
|||||||
KeepAliveInterval int `yaml:"keep-alive-interval" json:"keep-alive-interval"`
|
KeepAliveInterval int `yaml:"keep-alive-interval" json:"keep-alive-interval"`
|
||||||
DisableKeepAlive bool `yaml:"disable-keep-alive" json:"disable-keep-alive"`
|
DisableKeepAlive bool `yaml:"disable-keep-alive" json:"disable-keep-alive"`
|
||||||
|
|
||||||
ProxyProvider map[string]map[string]any `yaml:"proxy-providers" json:"proxy-providers"`
|
ProxyProvider *orderedmap.OrderedMap[string, map[string]any] `yaml:"proxy-providers" json:"proxy-providers"`
|
||||||
RuleProvider map[string]map[string]any `yaml:"rule-providers" json:"rule-providers"`
|
RuleProvider map[string]map[string]any `yaml:"rule-providers" json:"rule-providers"`
|
||||||
Proxy []map[string]any `yaml:"proxies" json:"proxies"`
|
Proxy []map[string]any `yaml:"proxies" json:"proxies"`
|
||||||
ProxyGroup []map[string]any `yaml:"proxy-groups" json:"proxy-groups"`
|
ProxyGroup []map[string]any `yaml:"proxy-groups" json:"proxy-groups"`
|
||||||
@ -480,6 +480,7 @@ func DefaultRawConfig() *RawConfig {
|
|||||||
Rule: []string{},
|
Rule: []string{},
|
||||||
Proxy: []map[string]any{},
|
Proxy: []map[string]any{},
|
||||||
ProxyGroup: []map[string]any{},
|
ProxyGroup: []map[string]any{},
|
||||||
|
ProxyProvider: orderedmap.New[string, map[string]any](),
|
||||||
TCPConcurrent: false,
|
TCPConcurrent: false,
|
||||||
FindProcessMode: process.FindProcessStrict,
|
FindProcessMode: process.FindProcessStrict,
|
||||||
GlobalUA: "clash.meta/" + C.Version,
|
GlobalUA: "clash.meta/" + C.Version,
|
||||||
@ -902,7 +903,8 @@ func parseProxies(cfg *RawConfig) (proxies map[string]C.Proxy, providersMap map[
|
|||||||
|
|
||||||
var AllProviders []string
|
var AllProviders []string
|
||||||
// parse and initial providers
|
// parse and initial providers
|
||||||
for name, mapping := range providersConfig {
|
for pair := providersConfig.Oldest(); pair != nil; pair = pair.Next() {
|
||||||
|
name, mapping := pair.Key, pair.Value
|
||||||
if name == provider.ReservedName {
|
if name == provider.ReservedName {
|
||||||
return nil, nil, fmt.Errorf("can not defined a provider called `%s`", provider.ReservedName)
|
return nil, nil, fmt.Errorf("can not defined a provider called `%s`", provider.ReservedName)
|
||||||
}
|
}
|
||||||
@ -917,7 +919,6 @@ func parseProxies(cfg *RawConfig) (proxies map[string]C.Proxy, providersMap map[
|
|||||||
}
|
}
|
||||||
|
|
||||||
slices.Sort(AllProxies)
|
slices.Sort(AllProxies)
|
||||||
slices.Sort(AllProviders)
|
|
||||||
|
|
||||||
// parse proxy group
|
// parse proxy group
|
||||||
for idx, mapping := range groupsConfig {
|
for idx, mapping := range groupsConfig {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user