Fix UDP domain NAT

This commit is contained in:
世界 2023-10-25 12:00:00 +08:00
parent 23aa8a0543
commit cb2e15f8a7
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
11 changed files with 138 additions and 13 deletions

View file

@ -835,7 +835,7 @@ func (r *Router) RoutePacketConnection(ctx context.Context, conn N.PacketConn, m
}
}
if metadata.FakeIP {
conn = fakeip.NewNATPacketConn(conn, metadata.OriginDestination, metadata.Destination)
conn = bufio.NewNATPacketConn(bufio.NewNetPacketConn(conn), metadata.OriginDestination, metadata.Destination)
}
return detour.NewPacketConnection(ctx, conn, metadata)
}