chore: clash.mini hack.
This commit is contained in:
parent
dd66f8826c
commit
6ceb2eb505
1 changed files with 12 additions and 1 deletions
|
@ -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 a new issue