Skip to content

Commit e548b93

Browse files
committed
using hub.ApplyConfig to start the external controller
1 parent 90f3a09 commit e548b93

File tree

1 file changed

+4
-14
lines changed
  • core/src/main/golang/native/config

1 file changed

+4
-14
lines changed

core/src/main/golang/native/config/load.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import (
99
"gopkg.in/yaml.v2"
1010

1111
"cfa/native/app"
12-
"github.com/metacubex/mihomo/log"
1312

1413
"github.com/metacubex/mihomo/config"
15-
"github.com/metacubex/mihomo/hub/executor"
16-
"github.com/metacubex/mihomo/hub/route"
14+
"github.com/metacubex/mihomo/hub"
15+
"github.com/metacubex/mihomo/log"
1716
)
1817

1918
func logDns(cfg *config.RawConfig) {
@@ -79,16 +78,7 @@ func Load(path string) error {
7978

8079
// Start the external controller like in hub.Parse(), but we have set its
8180
// default override value to end with ":0" for security.
82-
//
83-
// It would be difficult to update configurations for external controller
84-
// inbound, so changes will require a restart after a profile is loaded.
85-
if cfg.Controller.ExternalController != "" && !strings.HasSuffix(cfg.Controller.ExternalController, ":0") {
86-
go route.Start(cfg.Controller.ExternalController, cfg.Controller.ExternalControllerTLS,
87-
cfg.Controller.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey, cfg.Controller.ExternalDohServer,
88-
cfg.General.LogLevel == log.DEBUG)
89-
}
90-
91-
executor.ApplyConfig(cfg, true)
81+
hub.ApplyConfig(cfg)
9282

9383
app.ApplySubtitlePattern(rawCfg.ClashForAndroid.UiSubtitlePattern)
9484

@@ -103,5 +93,5 @@ func LoadDefault() {
10393
panic(err.Error())
10494
}
10595

106-
executor.ApplyConfig(cfg, true)
96+
hub.ApplyConfig(cfg)
10797
}

0 commit comments

Comments
 (0)