From 2693ba61c450c825c923a24e7a7b3c349644ee0e Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Wed, 18 Dec 2024 19:05:19 +0800 Subject: [PATCH] forwarder: fix ip matcher for tls --- internal/util/forwarder/sniffer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/util/forwarder/sniffer.go b/internal/util/forwarder/sniffer.go index 68d23c45..05847176 100644 --- a/internal/util/forwarder/sniffer.go +++ b/internal/util/forwarder/sniffer.go @@ -851,8 +851,11 @@ func (h *Sniffer) dialTLS(ctx context.Context, host string, ho *HandleOptions) ( Addr: host, } } + + ro := ho.RecorderObject if ho.Hop != nil { node = ho.Hop.Select(ctx, + hop.ClientIPSelectOption(net.ParseIP(ro.ClientIP)), hop.HostSelectOption(host), hop.ProtocolSelectOption(sniffing.ProtoTLS), ) @@ -862,7 +865,6 @@ func (h *Sniffer) dialTLS(ctx context.Context, host string, ho *HandleOptions) ( return } - ro := ho.RecorderObject addr := node.Addr if opts := node.Options(); opts != nil { switch opts.Network {