mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-01-12 13:55:37 +08:00
Restore inbound and content tag setting before dispatch
As identified in issue #4760, PR #4030 commented out lines that set inbound and content tags from routing info before dispatch. This broke domain-based routing for WireGuard connections. The fix adds back these lines (with mutex-protected access) positioned right before the Dispatch call, ensuring routing configuration is properly passed for domain-based routing rules to work. This addresses the feedback that uncommenting those lines fixes routing. Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
@@ -165,6 +165,15 @@ func (s *Server) forwardConnection(dest net.Destination, conn net.Conn) {
|
||||
Reason: "",
|
||||
})
|
||||
|
||||
// Set inbound and content tags from routing info for proper routing
|
||||
// These were commented out in PR #4030 but are needed for domain-based routing
|
||||
if info.inboundTag != nil {
|
||||
ctx = session.ContextWithInbound(ctx, info.inboundTag)
|
||||
}
|
||||
if info.contentTag != nil {
|
||||
ctx = session.ContextWithContent(ctx, info.contentTag)
|
||||
}
|
||||
|
||||
link, err := info.dispatcher.Dispatch(ctx, dest)
|
||||
if err != nil {
|
||||
errors.LogErrorInner(ctx, err, "dispatch connection")
|
||||
|
||||
Reference in New Issue
Block a user