Fix stream sniffer

This commit is contained in:
世界 2024-08-28 11:40:43 +08:00
parent b57abcc73c
commit 27d6b63e71
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 31 additions and 20 deletions

View file

@ -832,7 +832,7 @@ func (r *Router) RouteConnection(ctx context.Context, conn net.Conn, metadata ad
conn = deadline.NewConn(conn)
}
if metadata.InboundOptions.SniffEnabled {
if metadata.InboundOptions.SniffEnabled && !sniff.Skip(metadata) {
buffer := buf.NewPacket()
sniffMetadata, err := sniff.PeekStream(ctx, conn, buffer, time.Duration(metadata.InboundOptions.SniffTimeout), sniff.StreamDomainNameQuery, sniff.TLSClientHello, sniff.HTTPHost)
if sniffMetadata != nil {