VLESS & VMess are not ready to accept FullCone yet

This commit is contained in:
RPRX 2020-12-30 08:10:26 +00:00 committed by GitHub
parent 2da07e0f8a
commit 310a938511
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 13 deletions

View file

@ -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)
}
}
}