mitm: Index | Files

package mitm

import ""


Package Files

cert.go mitm.go

func GenCA Uses

func GenCA(name string) (certPEM, keyPEM []byte, err error)

type Proxy Uses

type Proxy struct {
    // Wrap specifies a function for optionally wrapping upstream for
    // inspecting the decrypted HTTP request and response.
    Wrap func(upstream http.Handler) http.Handler

    // CA specifies the root CA for generating leaf certs for each incoming
    // TLS request.
    CA  *tls.Certificate

    // TLSServerConfig specifies the tls.Config to use when generating leaf
    // cert using CA.
    TLSServerConfig *tls.Config

    // TLSClientConfig specifies the tls.Config to use when establishing
    // an upstream connection for proxying.
    TLSClientConfig *tls.Config

    // FlushInterval specifies the flush interval
    // to flush to the client while copying the
    // response body.
    // If zero, no periodic flushing is done.
    FlushInterval time.Duration

Proxy is a forward proxy that substitutes its own certificate for incoming TLS connections in place of the upstream server's certificate.

func (*Proxy) ServeHTTP Uses

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

Package mitm imports 16 packages (graph). Updated 2020-08-07. Refresh now. Tools for package owners.