testingproxy

package
v3.19.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package testingproxy contains shared test cases for the proxies.

Index

Constants

This section is empty.

Variables

View Source
var HTTPTestCases = []TestCase{

	WithHostNetworkHTTPProxyAndURL("http://www.example.com/"),
	WithHostNetworkHTTPProxyAndURL("https://www.example.com/"),

	WithHostNetworkHTTPWithTLSProxyAndURL("http://www.example.com/"),
	WithHostNetworkHTTPWithTLSProxyAndURL("https://www.example.com/"),

	WithNetemHTTPProxyAndURL("http://www.example.com/"),
	WithNetemHTTPProxyAndURL("https://www.example.com/"),

	WithNetemHTTPWithTLSProxyAndURL("http://www.example.com/"),
	WithNetemHTTPWithTLSProxyAndURL("https://www.example.com/"),
}

HTTPTestCases contains the HTTP test cases.

View Source
var SOCKSTestCases = []TestCase{

	WithHostNetworkSOCKSProxyAndURL("http://www.example.com/"),
	WithHostNetworkSOCKSProxyAndURL("https://www.example.com/"),

	WithNetemSOCKSProxyAndURL("http://www.example.com/"),
	WithNetemSOCKSProxyAndURL("https://www.example.com/"),

	WithNetemSOCKSProxyAndURL("http://93.184.216.34/"),
	WithNetemSOCKSProxyAndURL("https://93.184.216.34/"),
}

SOCKSTestCases contains the SOCKS test cases.

Functions

This section is empty.

Types

type TestCase

type TestCase interface {
	// Name returns the test case name.
	Name() string

	// Run runs the test case.
	Run(t *testing.T)

	// Short returns whether this is a short test.
	Short() bool
}

TestCase is a test case implemented by this package.

func WithHostNetworkHTTPProxyAndURL

func WithHostNetworkHTTPProxyAndURL(URL string) TestCase

WithHostNetworkHTTPProxyAndURL returns a TestCase where:

- we fetch a URL;

- using the host network;

- and an HTTP proxy.

Because this TestCase uses the host network, it does not run in -short mode.

func WithHostNetworkHTTPWithTLSProxyAndURL

func WithHostNetworkHTTPWithTLSProxyAndURL(URL string) TestCase

WithHostNetworkHTTPWithTLSProxyAndURL returns a TestCase where:

- we fetch a URL;

- using the host network;

- and an HTTPS proxy.

Because this TestCase uses the host network, it does not run in -short mode.

func WithHostNetworkSOCKSProxyAndURL

func WithHostNetworkSOCKSProxyAndURL(URL string) TestCase

WithHostNetworkSOCKSProxyAndURL returns a TestCase where:

- we fetch a URL;

- using the host network;

- and a SOCKS5 proxy.

Because this TestCase uses the host network, it does not run in -short mode.

func WithNetemHTTPProxyAndURL

func WithNetemHTTPProxyAndURL(URL string) TestCase

WithNetemHTTPProxyAndURL returns a TestCase where:

- we fetch a URL;

- using the github.com/ooni.netem;

- and an HTTP proxy.

Because this TestCase uses netem, it also runs in -short mode.

func WithNetemHTTPWithTLSProxyAndURL

func WithNetemHTTPWithTLSProxyAndURL(URL string) TestCase

WithNetemHTTPWithTLSProxyAndURL returns a TestCase where:

- we fetch a URL;

- using the github.com/ooni.netem;

- and an HTTPS proxy.

Because this TestCase uses netem, it also runs in -short mode.

func WithNetemSOCKSProxyAndURL

func WithNetemSOCKSProxyAndURL(URL string) TestCase

WithNetemSOCKSProxyAndURL returns a TestCase where:

- we fetch a URL;

- using the github.com/ooni.netem;

- and a SOCKS5 proxy.

Because this TestCase uses netem, it also runs in -short mode.

Jump to

Keyboard shortcuts

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