From 0a3c449cdf16f8dbd1f3823621f2a22806c43677 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Sat, 25 May 2024 19:10:59 -0400 Subject: [PATCH] Inbound worker should fill context outbounds info https://github.com/XTLS/Xray-core/issues/3388 --- app/proxyman/inbound/worker.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/proxyman/inbound/worker.go b/app/proxyman/inbound/worker.go index 9a6499f1..539508e1 100644 --- a/app/proxyman/inbound/worker.go +++ b/app/proxyman/inbound/worker.go @@ -308,12 +308,11 @@ func (w *udpWorker) callback(b *buf.Buffer, source net.Destination, originalDest sid := session.NewID() ctx = session.ContextWithID(ctx, sid) + outbounds := []*session.Outbound{{}} if originalDest.IsValid() { - outbounds := []*session.Outbound{{ - Target: originalDest, - }} - ctx = session.ContextWithOutbounds(ctx, outbounds) + outbounds[0].Target = originalDest } + ctx = session.ContextWithOutbounds(ctx, outbounds) ctx = session.ContextWithInbound(ctx, &session.Inbound{ Source: source, Gateway: net.UDPDestination(w.address, w.port),