...

Source file src/github.com/docker/go-connections/sockets/sockets_windows.go

Documentation: github.com/docker/go-connections/sockets

     1  package sockets
     2  
     3  import (
     4  	"context"
     5  	"net"
     6  	"net/http"
     7  	"time"
     8  
     9  	"github.com/Microsoft/go-winio"
    10  )
    11  
    12  func configureUnixTransport(tr *http.Transport, proto, addr string) error {
    13  	return ErrProtocolNotAvailable
    14  }
    15  
    16  func configureNpipeTransport(tr *http.Transport, proto, addr string) error {
    17  	// No need for compression in local communications.
    18  	tr.DisableCompression = true
    19  	tr.DialContext = func(ctx context.Context, _, _ string) (net.Conn, error) {
    20  		return winio.DialPipeContext(ctx, addr)
    21  	}
    22  	return nil
    23  }
    24  
    25  // DialPipe connects to a Windows named pipe.
    26  func DialPipe(addr string, timeout time.Duration) (net.Conn, error) {
    27  	return winio.DialPipe(addr, &timeout)
    28  }
    29  

View as plain text