HCR SUPPORT

This commit is contained in:
2026-09-13 22:31:36 -03:00
parent ede2e9eb89
commit 2b5a8c4452
13 changed files with 2393 additions and 5 deletions
+13
View File
@@ -477,6 +477,19 @@ func applyFullConfigReload(newCfg *Config) ConfigReloadReport {
report.Services["btun"] = ServiceReloadStatus{Enabled: false, Running: false}
}
// HCR — stop current instance (no-op if not running) then start new one.
stopHCR()
if newCfg.HCR != nil {
if err := startHCR(newCfg.HCR); err != nil {
report.warnf("HCR failed to start: %v", err)
report.Services["hcr"] = ServiceReloadStatus{Enabled: true, Running: false, Listen: hcrConfiguredListen(newCfg.HCR), Error: err.Error()}
} else {
report.Services["hcr"] = ServiceReloadStatus{Enabled: true, Running: hcrRunning(), Listen: hcrListenList()}
}
} else {
report.Services["hcr"] = ServiceReloadStatus{Enabled: false, Running: false}
}
// Xray — update stored config then restart/stop as needed.
if newCfg.Xray != nil {
newCfg.Xray.NormalizeDefaults()