13 const maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path)
15 func configureUnixTransport(tr *http.Transport, proto, addr string) error {
16 if len(addr) > maxUnixSocketPathSize {
17 return fmt.Errorf("Unix socket path %q is too long", addr)
19 // No need for compression in local communications.
20 tr.DisableCompression = true
21 tr.Dial = func(_, _ string) (net.Conn, error) {
22 return net.DialTimeout(proto, addr, defaultTimeout)
27 func configureNpipeTransport(tr *http.Transport, proto, addr string) error {
28 return ErrProtocolNotAvailable
31 // DialPipe connects to a Windows named pipe.
32 // This is not supported on other OSes.
33 func DialPipe(_ string, _ time.Duration) (net.Conn, error) {
34 return nil, syscall.EAFNOSUPPORT