mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +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"`
|
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
|
// Parse config
|
||||||
func Parse(buf []byte) (*Config, error) {
|
func Parse(buf []byte) (*Config, error) {
|
||||||
rawCfg, err := UnmarshalRawConfig(buf)
|
rawCfg, err := UnmarshalRawConfig(buf)
|
||||||
|
@ -527,7 +533,12 @@ func parseProxies(cfg *RawConfig) (proxies map[string]C.Proxy, providersMap map[
|
||||||
[]providerTypes.ProxyProvider{pd},
|
[]providerTypes.ProxyProvider{pd},
|
||||||
)
|
)
|
||||||
proxies["GLOBAL"] = adapter.NewProxy(global)
|
proxies["GLOBAL"] = adapter.NewProxy(global)
|
||||||
|
ProxiesList = proxiesList
|
||||||
|
GroupsList = groupsList
|
||||||
|
if ParsingProxiesCallback != nil {
|
||||||
|
// refresh tray menu
|
||||||
|
go ParsingProxiesCallback(GroupsList, ProxiesList)
|
||||||
|
}
|
||||||
return proxies, providersMap, nil
|
return proxies, providersMap, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user