(socketPath string)
| 120 | } |
| 121 | |
| 122 | func handleUnixDomainSocket(socketPath string) http.RoundTripper { |
| 123 | if socketPath == "" { |
| 124 | return http.DefaultTransport |
| 125 | } |
| 126 | |
| 127 | dialContext := func(ctx context.Context, network, addr string) (net.Conn, error) { |
| 128 | return (&net.Dialer{}).DialContext(ctx, "unix", socketPath) |
| 129 | } |
| 130 | |
| 131 | return &http.Transport{ |
| 132 | DialContext: dialContext, |
| 133 | DisableKeepAlives: true, |
| 134 | } |
| 135 | } |