From 2776ea6d7426e1d024924df02d749d7021b2747f Mon Sep 17 00:00:00 2001 From: Jorik_Smith <100627853+JorikSmith@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:59:04 +0300 Subject: [PATCH] SS2022 outbound: Close connection to server on early returns (#6698) https://github.com/XTLS/Xray-core/pull/6698#issuecomment-5468662565 --- proxy/shadowsocks_2022/outbound.go | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy/shadowsocks_2022/outbound.go b/proxy/shadowsocks_2022/outbound.go index f1195950d..5d1b9c9fb 100644 --- a/proxy/shadowsocks_2022/outbound.go +++ b/proxy/shadowsocks_2022/outbound.go @@ -82,6 +82,7 @@ func (o *Outbound) Process(ctx context.Context, link *transport.Link, dialer int if err != nil { return errors.New("failed to connect to server").Base(err) } + defer connection.Close() if session.TimeoutOnlyFromContext(ctx) { ctx, _ = context.WithCancel(context.Background())