mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-03 18:28:52 +00:00
copy inbound
This commit is contained in:
@@ -229,10 +229,13 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn stat.Connection, dis
|
|||||||
}
|
}
|
||||||
changeRemote.Do(func() {
|
changeRemote.Do(func() {
|
||||||
if inbound != nil {
|
if inbound != nil {
|
||||||
|
newInbound := *inbound
|
||||||
// change source to real remote UDP address
|
// change source to real remote UDP address
|
||||||
inbound.Source = net.DestinationFromAddr(conn.RemoteAddr())
|
newInbound.Source = net.DestinationFromAddr(conn.RemoteAddr())
|
||||||
inbound.Local = net.DestinationFromAddr(conn.LocalAddr())
|
newInbound.Local = net.DestinationFromAddr(conn.LocalAddr())
|
||||||
errors.LogInfo(ctx, "client UDP connection from ", inbound.Source)
|
inbound = &newInbound
|
||||||
|
ctx = session.ContextWithInbound(ctx, &newInbound)
|
||||||
|
errors.LogInfo(ctx, "client UDP connection from ", newInbound.Source)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user