Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultUpstreamConnectTimeout = 10 * time.Second
)
Variables ¶
View Source
var (
ErrNoCertificate = errors.New("MitM: no certificates configured")
)
Functions ¶
This section is empty.
Types ¶
type MITMProxy ¶
type MITMProxy struct { // GetCertificate should return a tls.Certificate based on the given Request and ClientHelloInfo // If we don't have a certificate for the requested upstream, then this should return // (nil, ErrNoCertificate); in which case the connection will be tunneled encrypted, as a normal // HTTP proxy would do. GetCertificate func(*http.Request, *tls.ClientHelloInfo) (*tls.Certificate, error) // Wrap specifies a function for optionally wrapping upstream for // inspecting the decrypted HTTP request and response. // Can be left nil. Wrap func(upstream *httputil.ReverseProxy) http.Handler // TLSClientConfig specifies the tls.Config to use when establishing // an upstream connection for proxying. TLSClientConfig *tls.Config // Timeout to connect upstream. // // The timeout includes name resolution, if required. // When using TCP, and the host in the address parameter resolves to // multiple IP addresses, the timeout is spread over each consecutive // dial, such that each is given an appropriate fraction of the time // to connect. // // Defaults to DefaultUpstreamConnectTimeout UpstreamConnectTimeout time.Duration // Optional handler for any error that might happen while handling a CONNECT request // This is optional, and would typically be used for logging // If defined, it must be a thread-safe function // Shame there's no standard logging interface in go :( ConnectErrorLogger func(err error) }
Click to show internal directories.
Click to hide internal directories.