From 6ca6d8a693240b105f3e377c404417503871f1c2 Mon Sep 17 00:00:00 2001 From: Yuriy Tumanov <57435526+Eljees@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:21:32 +0100 Subject: [PATCH] Commands: Fix `xray api bi balancer1 balancer2` (#7299) https://github.com/XTLS/Xray-core/pull/7279#issuecomment-6468250523 --------- Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com> --- main/commands/all/api/balancer_info.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/main/commands/all/api/balancer_info.go b/main/commands/all/api/balancer_info.go index cabc66d98..97ab9f7ba 100644 --- a/main/commands/all/api/balancer_info.go +++ b/main/commands/all/api/balancer_info.go @@ -47,18 +47,19 @@ func executeBalancerInfo(cmd *base.Command, args []string) { conn, ctx, close := dialAPIServer() defer close() client := routerService.NewRoutingServiceClient(conn) - r := &routerService.GetBalancerInfoRequest{Tag: unnamedArgs[0]} - resp, err := client.GetBalancerInfo(ctx, r) - if err != nil { - base.Fatalf("failed to get health information: %s", err) - } + for _, tag := range unnamedArgs { + r := &routerService.GetBalancerInfoRequest{Tag: tag} + resp, err := client.GetBalancerInfo(ctx, r) + if err != nil { + base.Fatalf("failed to get health information: %s", err) + } - if apiJSON { - showJSONResponse(resp) - return + if apiJSON { + showJSONResponse(resp) + } else { + showBalancerInfo(resp.Balancer) + } } - - showBalancerInfo(resp.Balancer) } func showBalancerInfo(b *routerService.BalancerMsg) {