proxytest

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package proxytest is a small HTTP CONNECT proxy for tests. Every tunnel goes to one backend address, whatever host the client asks for, so a test can use a name like example.com and still reach its own server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	URL string // http://127.0.0.1:PORT
	// contains filtered or unexported fields
}

Proxy records what it was asked.

func Start

func Start(t testing.TB, backend string, status int) *Proxy

Start runs a proxy that tunnels every CONNECT to backend until the test ends. A status other than 200 refuses every tunnel with it.

func (*Proxy) Auth

func (p *Proxy) Auth() []string

Auth are the Proxy-Authorization headers sent so far.

func (*Proxy) Hosts

func (p *Proxy) Hosts() []string

Hosts are the CONNECT targets asked for so far.

Jump to

Keyboard shortcuts

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