Fix TLS sniffer storing IP literal server names as domain

This commit is contained in:
世界 committed 2026-10-23 19:57:05 +08:00
1 parent f334051eb4
commit 0d264e4ec7
1 file changed
+2 -1
+2 -1
View File
@@ -10,6 +10,7 @@ import (
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing/common/bufio"
E "github.com/sagernet/sing/common/exceptions"
M "github.com/sagernet/sing/common/metadata"
)
func TLSClientHello(ctx context.Context, metadata *adapter.InboundContext, reader io.Reader) error {
@@ -22,7 +23,7 @@ func TLSClientHello(ctx context.Context, metadata *adapter.InboundContext, reade
}).HandshakeContext(ctx)
if clientHello != nil {
metadata.Protocol = C.ProtocolTLS
metadata.Domain = clientHello.ServerName
metadata.Domain = M.ParseSocksaddrHostPort(clientHello.ServerName, 0).Fqdn
return nil
}
if errors.Is(err, io.ErrUnexpectedEOF) {