proxy

package
v0.0.0-...-a3451e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2019 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCertCache

func SetCertCache(cache map[string]tls.Certificate)

SetCertCache initializes the certificate cache and starts the go routine that serves the cache requests.

func TransformTracerString

func TransformTracerString(tracerString []byte) (string, []byte, error)

TransformTracerString returns a random string that is used to track the tracer and the actual payload as a slice of bytes.

Types

type CertCacheEntry

type CertCacheEntry struct {
	Host  string `json:"Host"`
	Certs KeyPairBytes
}

CertCacheEntry is an entry in the certificate cache. It contains the host and the KeyPairBytes that was used to generate the certificate.

type KeyPairBytes

type KeyPairBytes struct {
	CertPEM []byte `json:"CertPEM"`
	KeyPEM  []byte `json:"KeyPEM"`
}

KeyPairBytes is a byte representation of the certificate and private key for specific host's signed certificate. This is serialized in a cache file to be reused when the program terminates.

type Proxy

type Proxy struct {
	HTTPTransport     http.Transport
	HTTPBufferPool    *sync.Pool
	HTTPBytePool      *sync.Pool
	WebSocketUpgrader websocket.Upgrader
	WebSocketDialer   websocket.Dialer
}

Proxy is the object that stores the configured proxy TCP listener for the tracy proxy.

func New

func New(transport http.Transport, upgrader websocket.Upgrader,
	dialer websocket.Dialer, bp, bufp *sync.Pool) *Proxy

New instantiates a Proxy object with the passed in net.Listener, http.Transport, and websocket.Dialer.

func (*Proxy) ServeHTTP

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

ServeHTTP handles any HTTP connections to the proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL