mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 21:31:16 +08:00
chore: clash.mini hack.
This commit is contained in:
parent
503b1efd8a
commit
253dc24e40
@ -240,6 +240,12 @@ type RawSniffer struct {
|
||||
Ports []string `yaml:"port-whitelist" json:"port-whitelist"`
|
||||
}
|
||||
|
||||
var (
|
||||
GroupsList = list.New()
|
||||
ProxiesList = list.New()
|
||||
ParsingProxiesCallback func(groupsList *list.List, proxiesList *list.List)
|
||||
)
|
||||
|
||||
// Parse config
|
||||
func Parse(buf []byte) (*Config, error) {
|
||||
rawCfg, err := UnmarshalRawConfig(buf)
|
||||
@ -527,7 +533,12 @@ func parseProxies(cfg *RawConfig) (proxies map[string]C.Proxy, providersMap map[
|
||||
[]providerTypes.ProxyProvider{pd},
|
||||
)
|
||||
proxies["GLOBAL"] = adapter.NewProxy(global)
|
||||
|
||||
ProxiesList = proxiesList
|
||||
GroupsList = groupsList
|
||||
if ParsingProxiesCallback != nil {
|
||||
// refresh tray menu
|
||||
go ParsingProxiesCallback(GroupsList, ProxiesList)
|
||||
}
|
||||
return proxies, providersMap, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user