Propagate DCOverrides

This commit is contained in:
9seconds
2026-02-16 14:58:41 +01:00
parent 0a5a45b32d
commit 836a481026
9 changed files with 164 additions and 6 deletions
+9
View File
@@ -240,6 +240,14 @@ func runProxy(conf *config.Config, version string) error { //nolint: funlen
return fmt.Errorf("cannot build ip allowlist: %w", err)
}
dcOverrides := map[int][]string{}
for _, override := range conf.DCOverrides {
dcid := override.DC.Get()
for _, addr := range override.IPs {
dcOverrides[dcid] = append(dcOverrides[dcid], addr.Get(""))
}
}
opts := mtglib.ProxyOpts{
Logger: logger,
Network: ntw,
@@ -254,6 +262,7 @@ func runProxy(conf *config.Config, version string) error { //nolint: funlen
AllowFallbackOnUnknownDC: conf.AllowFallbackOnUnknownDC.Get(false),
TolerateTimeSkewness: conf.TolerateTimeSkewness.Value,
DCOverrides: dcOverrides,
}
proxy, err := mtglib.NewProxy(opts)