From 12a2db8f5aa338e66c6d1c7d085cd3475e8c8637 Mon Sep 17 00:00:00 2001 From: mzz2017 <2017@duck.com> Date: Wed, 9 Aug 2023 22:20:17 +0800 Subject: [PATCH] chore: fix building --- cmd/run.go | 4 ++-- common/netutils/dns.go | 2 +- component/outbound/dialer/connectivity_check.go | 2 +- component/outbound/dialer/trojan/trojan.go | 2 +- component/outbound/dialer/v2ray/v2ray.go | 2 +- control/dns_control.go | 2 +- control/tcp.go | 2 +- control/udp_endpoint.go | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index d5d161400..90c6d0540 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -277,7 +277,7 @@ func newControlPlane(log *logrus.Logger, bpf interface{}, dnsCache map[string]*c client := http.Client{ Transport: &http.Transport{ DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) { - cd := netproxy.ContextDialer{Dialer: direct.SymmetricDirect} + cd := netproxy.ContextDialerConverter{Dialer: direct.SymmetricDirect} conn, err := cd.DialContext(ctx, common.MagicNetwork("tcp", conf.Global.SoMarkFromDae), addr) if err != nil { return nil, err @@ -319,7 +319,7 @@ func newControlPlane(log *logrus.Logger, bpf interface{}, dnsCache map[string]*c client := http.Client{ Transport: &http.Transport{ DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) { - cd := netproxy.ContextDialer{Dialer: direct.SymmetricDirect} + cd := netproxy.ContextDialerConverter{Dialer: direct.SymmetricDirect} conn, err := cd.DialContext(ctx, common.MagicNetwork("tcp", conf.Global.SoMarkFromDae), addr) if err != nil { return nil, err diff --git a/common/netutils/dns.go b/common/netutils/dns.go index ff11066aa..fe7329963 100644 --- a/common/netutils/dns.go +++ b/common/netutils/dns.go @@ -211,7 +211,7 @@ func resolve(ctx context.Context, d netproxy.Dialer, dns netip.AddrPort, host st } // Dial and write. - cd := &netproxy.ContextDialer{Dialer: d} + cd := &netproxy.ContextDialerConverter{Dialer: d} c, err := cd.DialContext(ctx, network, dns.String()) if err != nil { return nil, err diff --git a/component/outbound/dialer/connectivity_check.go b/component/outbound/dialer/connectivity_check.go index 980e6515c..c26fff0ea 100644 --- a/component/outbound/dialer/connectivity_check.go +++ b/component/outbound/dialer/connectivity_check.go @@ -570,7 +570,7 @@ func (d *Dialer) HttpCheck(ctx context.Context, u *netutils.URL, ip netip.Addr, if method == "" { method = http.MethodGet } - cd := &netproxy.ContextDialer{Dialer: d.Dialer} + cd := &netproxy.ContextDialerConverter{Dialer: d.Dialer} cli := http.Client{ Transport: &http.Transport{ DialContext: func(ctx context.Context, network, addr string) (c net.Conn, err error) { diff --git a/component/outbound/dialer/trojan/trojan.go b/component/outbound/dialer/trojan/trojan.go index 9ac7f4b20..85a38a285 100644 --- a/component/outbound/dialer/trojan/trojan.go +++ b/component/outbound/dialer/trojan/trojan.go @@ -83,7 +83,7 @@ func (s *Trojan) Dialer(option *dialer.GlobalOption, nextDialer netproxy.Dialer) serviceName = "GunService" } d = &grpc.Dialer{ - NextDialer: &netproxy.ContextDialer{Dialer: d}, + NextDialer: &netproxy.ContextDialerConverter{Dialer: d}, ServiceName: serviceName, ServerName: s.Sni, AllowInsecure: s.AllowInsecure || option.AllowInsecure, diff --git a/component/outbound/dialer/v2ray/v2ray.go b/component/outbound/dialer/v2ray/v2ray.go index ee1295c85..c79636d3a 100644 --- a/component/outbound/dialer/v2ray/v2ray.go +++ b/component/outbound/dialer/v2ray/v2ray.go @@ -135,7 +135,7 @@ func (s *V2Ray) Dialer(option *dialer.GlobalOption, nextDialer netproxy.Dialer) serviceName = "GunService" } d = &grpc.Dialer{ - NextDialer: &netproxy.ContextDialer{Dialer: d}, + NextDialer: &netproxy.ContextDialerConverter{Dialer: d}, ServiceName: serviceName, ServerName: sni, AllowInsecure: s.AllowInsecure || option.AllowInsecure, diff --git a/control/dns_control.go b/control/dns_control.go index 2470891df..36556b911 100644 --- a/control/dns_control.go +++ b/control/dns_control.go @@ -556,7 +556,7 @@ func (c *DnsController) dialSend(invokingDepth int, req *udpRequest, data []byte ctxDial, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout) defer cancel() - bestContextDialer := netproxy.ContextDialer{ + bestContextDialer := netproxy.ContextDialerConverter{ Dialer: dialArgument.bestDialer, } diff --git a/control/tcp.go b/control/tcp.go index 7c84762f7..0f100ba5b 100644 --- a/control/tcp.go +++ b/control/tcp.go @@ -188,7 +188,7 @@ func (c *ControlPlane) RouteDialTcp(p *RouteDialParam) (conn netproxy.Conn, err } ctx, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout) defer cancel() - cd := netproxy.ContextDialer{ + cd := netproxy.ContextDialerConverter{ Dialer: d, } return cd.DialContext(ctx, common.MagicNetwork("tcp", routingResult.Mark), dialTarget) diff --git a/control/udp_endpoint.go b/control/udp_endpoint.go index 16aa9cada..b142e5c07 100644 --- a/control/udp_endpoint.go +++ b/control/udp_endpoint.go @@ -121,7 +121,7 @@ begin: if err != nil { return nil, false, err } - cd := netproxy.ContextDialer{ + cd := netproxy.ContextDialerConverter{ Dialer: dialOption.Dialer, } ctx, cancel := context.WithTimeout(context.TODO(), consts.DefaultDialTimeout)