From 8996eb62406886f8ca46846ec0136d8eade0c29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Sat, 23 Nov 2024 10:29:22 +0000 Subject: [PATCH] Wireguard inboud: Add missing inbound session information back --- proxy/wireguard/server.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy/wireguard/server.go b/proxy/wireguard/server.go index 8ab84fe4..bdf27568 100644 --- a/proxy/wireguard/server.go +++ b/proxy/wireguard/server.go @@ -144,14 +144,15 @@ func (s *Server) forwardConnection(dest net.Destination, conn net.Conn) { Reason: "", }) + if s.info.inboundTag != nil { + ctx = session.ContextWithInbound(ctx, s.info.inboundTag) + } + // what's this? // Session information should not be shared between different connections // why reuse them in server level? This will cause incorrect destoverride and unexpected routing behavior. // Disable it temporarily. Maybe s.info should be removed. - // if s.info.inboundTag != nil { - // ctx = session.ContextWithInbound(ctx, s.info.inboundTag) - // } // if s.info.outboundTag != nil { // ctx = session.ContextWithOutbounds(ctx, []*session.Outbound{s.info.outboundTag}) // }