mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-06 05:05:01 +03:00
fix(fallback): derive a linked fallback's PROXY protocol header from its child (#6880)
Turning on Proxy Protocol for a local fallback target behind a VLESS/Trojan TLS master broke the fallback: the row was saved with xver 0, so the master sent no PROXY header and the child, now expecting one, rejected every connection (#6835). A fallback without an explicit dest already takes its address from the child at build time; it now also sends header v1 when the child accepts PROXY protocol (sockopt or the raw/ws/httpupgrade transport flag) and the row sets no xver of its own, so either order of enabling it works, from the panel or the API. Editing a child's listen, port or PROXY flag rebuilds the masters that derive from it, since re-adding only the child left them stale. Fixes #6835.
This commit is contained in:
@@ -2267,6 +2267,17 @@ func (s *InboundService) UpdateInbound(inbound *model.Inbound) (*model.Inbound,
|
||||
if err := tx.Save(oldInbound).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
// A master's running fallback was built from this child's listen, port and PROXY flag;
|
||||
// re-adding only the child would leave the master pointing at the old ones.
|
||||
if fallbackTargetChanged(&running, oldInbound) {
|
||||
linked, err := s.fallbackService.HasDerivedFallbackTo(tx, oldInbound.Id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if linked {
|
||||
needRestart = true
|
||||
}
|
||||
}
|
||||
newClients, gcErr := s.GetClients(oldInbound)
|
||||
if gcErr != nil {
|
||||
return gcErr
|
||||
|
||||
Reference in New Issue
Block a user