proxy

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

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

This section is empty.

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
	// contains filtered or unexported fields
}

A Proxy is an HTTP proxy that supports recording or replaying requests.

func ForRecording

func ForRecording(filename string, port int) (*Proxy, error)

ForRecording returns a Proxy configured to record.

func ForReplaying

func ForReplaying(filename string, port int) (*Proxy, error)

ForReplaying returns a Proxy configured to replay.

func (*Proxy) Close

func (p *Proxy) Close() error

Close closes the proxy. If the proxy is recording, it also writes the log.

func (*Proxy) Transport

func (p *Proxy) Transport() *http.Transport

Transport returns an http.Transport for clients who want to talk to the proxy.

Jump to

Keyboard shortcuts

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