feat: installer fetched from the direct address sets it as the agent's own with the main one as fallback (and downloads from it); agents fall back to whichever address is not theirs; (direct) beside the connection status

This commit is contained in:
redtea committed 2026-10-15 11:34:58 +03:00
1 parent 021da93229
commit 79828e3f8a
11 files changed
+72 -25

No files matched your search

+2 -2
View File
@@ -319,7 +319,7 @@ func (a *Agent) pollOnce(ctx, reqCtx context.Context) error {
return err
}
a.applyTunnelHeader(ctx, resp.Header)
a.learnFallback(resp.Header.Get(proto.FallbackHeader))
a.learnAddrs(resp.Header.Get(proto.MainHeader), resp.Header.Get(proto.FallbackHeader))
a.applyTransport(resp.Header.Get(proto.TransportHeader))
a.dispatch(ctx, msg)
return nil
@@ -355,7 +355,7 @@ func (a *Agent) fetchConfig(ctx context.Context) bool {
}
defer resp.Body.Close()
a.applyTransport(resp.Header.Get(proto.TransportHeader))
a.learnFallback(resp.Header.Get(proto.FallbackHeader))
a.learnAddrs(resp.Header.Get(proto.MainHeader), resp.Header.Get(proto.FallbackHeader))
return a.applyTunnelHeader(ctx, resp.Header)
}