mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
VLESS & VMess are not ready to accept FullCone yet
This commit is contained in:
parent
2da07e0f8a
commit
310a938511
6 changed files with 41 additions and 13 deletions
|
@ -103,7 +103,7 @@ func (s *Server) handlerUDPPayload(ctx context.Context, conn internet.Connection
|
|||
}
|
||||
inbound.User = s.user
|
||||
|
||||
var dest net.Destination
|
||||
var dest *net.Destination
|
||||
|
||||
reader := buf.NewPacketReader(conn)
|
||||
for {
|
||||
|
@ -144,12 +144,12 @@ func (s *Server) handlerUDPPayload(ctx context.Context, conn internet.Connection
|
|||
|
||||
data.UDP = &destination
|
||||
|
||||
if dest.Network == 0 {
|
||||
dest = request.Destination() // JUST FOLLOW THE FIRST PACKET
|
||||
if !buf.Cone || dest == nil {
|
||||
dest = &destination
|
||||
}
|
||||
|
||||
currentPacketCtx = protocol.ContextWithRequestHeader(currentPacketCtx, request)
|
||||
udpServer.Dispatch(currentPacketCtx, dest, data)
|
||||
udpServer.Dispatch(currentPacketCtx, *dest, data)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn internet.Connection,
|
|||
newError("client UDP connection from ", inbound.Source).WriteToLog(session.ExportIDToError(ctx))
|
||||
}
|
||||
|
||||
var dest net.Destination
|
||||
var dest *net.Destination
|
||||
|
||||
reader := buf.NewPacketReader(conn)
|
||||
for {
|
||||
|
@ -260,12 +260,12 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn internet.Connection,
|
|||
|
||||
payload.UDP = &destination
|
||||
|
||||
if dest.Network == 0 {
|
||||
dest = destination // JUST FOLLOW THE FIRST PACKET
|
||||
if !buf.Cone || dest == nil {
|
||||
dest = &destination
|
||||
}
|
||||
|
||||
currentPacketCtx = protocol.ContextWithRequestHeader(currentPacketCtx, request)
|
||||
udpServer.Dispatch(currentPacketCtx, dest, payload)
|
||||
udpServer.Dispatch(currentPacketCtx, *dest, payload)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ func (s *Server) handleUDPPayload(ctx context.Context, clientReader *PacketReade
|
|||
inbound := session.InboundFromContext(ctx)
|
||||
user := inbound.User
|
||||
|
||||
var dest net.Destination
|
||||
var dest *net.Destination
|
||||
|
||||
for {
|
||||
select {
|
||||
|
@ -280,12 +280,12 @@ func (s *Server) handleUDPPayload(ctx context.Context, clientReader *PacketReade
|
|||
})
|
||||
newError("tunnelling request to ", p.Target).WriteToLog(session.ExportIDToError(ctx))
|
||||
|
||||
if dest.Network == 0 {
|
||||
dest = p.Target // JUST FOLLOW THE FIRST PACKET
|
||||
if !buf.Cone || dest == nil {
|
||||
dest = &p.Target
|
||||
}
|
||||
|
||||
for _, b := range p.Buffer {
|
||||
udpServer.Dispatch(ctx, dest, b)
|
||||
udpServer.Dispatch(ctx, *dest, b)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue