ronething commented on code in PR #2587:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2587#discussion_r2389758677


##########
internal/adc/client/executor.go:
##########
@@ -227,13 +228,32 @@ type HTTPADCExecutor struct {
        serverURL  string
 }
 
-// NewHTTPADCExecutor creates a new HTTPADCExecutor with the specified ADC 
Server URL
+// NewHTTPADCExecutor creates a new HTTPADCExecutor with the specified ADC 
Server URL.
+// serverURL can be "http(s)://host:port" or "unix:///path/to/socket" or 
"unix:/path/to/socket".
 func NewHTTPADCExecutor(serverURL string, timeout time.Duration) 
*HTTPADCExecutor {
+       httpClient := &http.Client{
+               Timeout: timeout,
+       }
+
+       if strings.HasPrefix(serverURL, "unix:") {
+               var socketPath string
+               if strings.HasPrefix(serverURL, "unix:///") {
+                       socketPath = strings.TrimPrefix(serverURL, "unix://")
+               } else {
+                       socketPath = strings.TrimPrefix(serverURL, "unix:")
+               }
+               transport := &http.Transport{
+                       DialContext: func(ctx context.Context, _, _ string) 
(net.Conn, error) {
+                               return net.Dial("unix", socketPath)

Review Comment:
   use DialContext? 
   ref: https://pkg.go.dev/net#Dialer.DialContext



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to