Documentation
¶
Overview ¶
Package httpunix provides a HTTP transport (net/http.RoundTripper) that uses Unix domain sockets instead of HTTP.
This is useful for non-browser connections within the same host, as it allows using the file system for credentials of both client and server, and guaranteeing unique names.
The URLs look like this:
http+unix://LOCATION/PATH_ETC
where LOCATION is translated to a file system path with Transport.RegisterLocation, and PATH_ETC follow normal http: scheme conventions.
Index ¶
Constants ¶
const Scheme = "http+unix"
Scheme is the URL scheme used for HTTP over UNIX domain sockets.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transport ¶
type Transport struct {
// DialTimeout is deprecated. Use context instead.
DialTimeout time.Duration
// RequestTimeout is deprecated and has no effect.
RequestTimeout time.Duration
// ResponseHeaderTimeout is deprecated. Use context instead.
ResponseHeaderTimeout time.Duration
// contains filtered or unexported fields
}
Transport is a http.RoundTripper that connects to Unix domain sockets.
func (*Transport) RegisterLocation ¶
RegisterLocation registers an URL location and maps it to the given file system path.
Calling RegisterLocation twice for the same location is a programmer error, and causes a panic.