Documentation
¶
Overview ¶
The proxy package provides a record/replay HTTP proxy. It is designed to support both an in-memory API (cloud.google.com/go/httpreplay) and a standalone server (cloud.google.com/go/httpreplay/cmd/httpr).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugHeaders = false
DebugHeaders helps to determine whether a header should be ignored. When true, if requests have the same method, URL and body but differ in a header, the first mismatched header is logged.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// The certificate that the proxy uses to participate in TLS.
CACert *x509.Certificate
// The URL of the proxy.
URL *url.URL
// Initial state of the client. Must be serializable with json.Marshal.
Initial interface{}
// contains filtered or unexported fields
}
A Proxy is an HTTP proxy that supports recording or replaying requests.
func ForRecording ¶
ForRecording returns a Proxy configured to record.
func ForReplaying ¶
ForReplaying returns a Proxy configured to replay.
func (*Proxy) Close ¶
Close closes the proxy. If the proxy is recording, it also writes the log.
Source Files
¶
- record.go
- replay.go
Click to show internal directories.
Click to hide internal directories.