Add stun sniffer

This commit is contained in:
世界
2022-07-16 12:01:02 +08:00
parent 8619e07d66
commit fe5618c35d
4 changed files with 54 additions and 1 deletions

View File

@@ -457,7 +457,7 @@ func (r *Router) RoutePacketConnection(ctx context.Context, conn N.PacketConn, m
if err != nil {
return err
}
sniffMetadata, err := sniff.PeekPacket(ctx, buffer.Bytes(), sniff.QUICClientHello)
sniffMetadata, err := sniff.PeekPacket(ctx, buffer.Bytes(), sniff.QUICClientHello, sniff.STUNMessage)
originDestination := metadata.Destination
if err == nil {
metadata.Protocol = sniffMetadata.Protocol