Skip to content

Commit

Permalink
chore: clash.mini hack.
Browse files Browse the repository at this point in the history
  • Loading branch information
MetaCubeX committed Jul 4, 2022
1 parent 503b1ef commit 253dc24
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 253dc24

Please sign in to comment.