From 49a255488fac8adac2cc24bf8df64ef7d276d652 Mon Sep 17 00:00:00 2001 From: Fangliding Date: Tue, 25 Aug 2026 23:33:21 +0800 Subject: [PATCH] Fix fillRequestHeader with nil inbound --- proxy/http/client.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/proxy/http/client.go b/proxy/http/client.go index 0e50edba3..e82a747fe 100644 --- a/proxy/http/client.go +++ b/proxy/http/client.go @@ -173,15 +173,18 @@ func fillRequestHeader(ctx context.Context, header []*Header) ([]*Header, error) outbounds := session.OutboundsFromContext(ctx) ob := outbounds[len(outbounds)-1] - if inbound == nil || ob == nil { - return nil, errors.New("missing inbound or outbound metadata from context") + var src net.Destination + if inbound != nil { + src = inbound.Source + } else { + src = net.TCPDestination(net.AnyIP, 0) } data := struct { Source net.Destination Target net.Destination }{ - Source: inbound.Source, + Source: src, Target: ob.Target, }