@@ -106,18 +106,18 @@ type XTransport struct {
106106 outboundSource * outboundSourcePolicy
107107}
108108
109- type sourceAwareProxyForwardDialer struct {
109+ type proxyDialer struct {
110110 xTransport * XTransport
111111}
112112
113- var _ netproxy.Dialer = (* sourceAwareProxyForwardDialer )(nil )
114- var _ netproxy.ContextDialer = (* sourceAwareProxyForwardDialer )(nil )
113+ var _ netproxy.Dialer = (* proxyDialer )(nil )
114+ var _ netproxy.ContextDialer = (* proxyDialer )(nil )
115115
116- func (dialer * sourceAwareProxyForwardDialer ) Dial (network , address string ) (net.Conn , error ) {
116+ func (dialer * proxyDialer ) Dial (network , address string ) (net.Conn , error ) {
117117 return dialer .DialContext (context .Background (), network , address )
118118}
119119
120- func (dialer * sourceAwareProxyForwardDialer ) DialContext (ctx context.Context , network , address string ) (net.Conn , error ) {
120+ func (dialer * proxyDialer ) DialContext (ctx context.Context , network , address string ) (net.Conn , error ) {
121121 if network != "tcp" && network != "tcp4" && network != "tcp6" {
122122 return nil , fmt .Errorf ("unsupported proxy forward network %q" , network )
123123 }
@@ -133,7 +133,7 @@ func (dialer *sourceAwareProxyForwardDialer) DialContext(ctx context.Context, ne
133133 if literal , err := netip .ParseAddr (host ); err == nil {
134134 addresses = []netip.Addr {literal }
135135 } else {
136- ips , _ , err := dialer .xTransport .resolveProxyEndpoint (host )
136+ ips , _ , err := dialer .xTransport .resolveProxy (host )
137137 if err != nil {
138138 return nil , fmt .Errorf ("unable to resolve proxy endpoint %q: %w" , host , err )
139139 }
@@ -373,7 +373,7 @@ func (xTransport *XTransport) rebuildTransport() {
373373
374374 cachedIPs , _ , _ := xTransport .loadCachedIPs (host )
375375 if xTransport .outboundSource .enabled () && xTransport .proxyDialer == nil && len (cachedIPs ) == 0 {
376- resolved , err := xTransport .coveredDestinationIPs (host , "HTTP" )
376+ resolved , err := xTransport .resolveDialIPs (host , "HTTP" )
377377 if err != nil {
378378 return nil , err
379379 }
@@ -538,7 +538,7 @@ func (xTransport *XTransport) rebuildTransport() {
538538
539539 cachedIPs , _ , _ := xTransport .loadCachedIPs (host )
540540 if xTransport .outboundSource .enabled () && len (cachedIPs ) == 0 {
541- resolved , err := xTransport .coveredDestinationIPs (host , "HTTP/3" )
541+ resolved , err := xTransport .resolveDialIPs (host , "HTTP/3" )
542542 if err != nil {
543543 return nil , err
544544 }
@@ -599,16 +599,16 @@ func (xTransport *XTransport) rebuildTransport() {
599599 }
600600}
601601
602- // coveredDestinationIPs resolves through the configured DNS policy before source binding.
603- func (xTransport * XTransport ) coveredDestinationIPs (host , kind string ) ([]net.IP , error ) {
602+ // resolveDialIPs resolves through the configured DNS policy before source binding.
603+ func (xTransport * XTransport ) resolveDialIPs (host , kind string ) ([]net.IP , error ) {
604604 if literal := ParseIP (host ); literal != nil {
605605 return []net.IP {literal }, nil
606606 }
607607 var ips []net.IP
608608 var ttl time.Duration
609609 var err error
610610 if xTransport .httpProxyFunction != nil && kind == "HTTP" {
611- ips , ttl , err = xTransport .resolveProxyEndpoint (host )
611+ ips , ttl , err = xTransport .resolveProxy (host )
612612 } else {
613613 ips , ttl , err = xTransport .resolve (host , xTransport .useIPv4 , xTransport .useIPv6 )
614614 }
@@ -752,8 +752,8 @@ func (xTransport *XTransport) resolve(host string, returnIPv4, returnIPv6 bool)
752752 return xTransport .resolveHost (host , returnIPv4 , returnIPv6 , true )
753753}
754754
755- // resolveProxyEndpoint avoids depending on the proxy to resolve its own address.
756- func (xTransport * XTransport ) resolveProxyEndpoint (host string ) ([]net.IP , time.Duration , error ) {
755+ // resolveProxy avoids depending on the proxy to resolve its own address.
756+ func (xTransport * XTransport ) resolveProxy (host string ) ([]net.IP , time.Duration , error ) {
757757 return xTransport .resolveHost (host , xTransport .useIPv4 , xTransport .useIPv6 , false )
758758}
759759
0 commit comments