mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 21:51:23 +08:00
26 lines
477 B
Go
26 lines
477 B
Go
package hub
|
|
|
|
import (
|
|
"github.com/Dreamacro/clash/hub/executor"
|
|
"github.com/Dreamacro/clash/hub/route"
|
|
)
|
|
|
|
// Parse call at the beginning of clash
|
|
func Parse() error {
|
|
cfg, err := executor.Parse()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if cfg.General.ExternalUI != "" {
|
|
route.SetUIPath(cfg.General.ExternalUI)
|
|
}
|
|
|
|
if cfg.General.ExternalController != "" {
|
|
go route.Start(cfg.General.ExternalController, cfg.General.Secret)
|
|
}
|
|
|
|
executor.ApplyConfig(cfg, true)
|
|
return nil
|
|
}
|