Documentation ¶
Overview ¶
Package testingproxy contains shared test cases for the proxies.
Index ¶
- Variables
- type TestCase
- func WithHostNetworkHTTPProxyAndURL(URL string) TestCase
- func WithHostNetworkHTTPWithTLSProxyAndURL(URL string) TestCase
- func WithHostNetworkSOCKSProxyAndURL(URL string) TestCase
- func WithNetemHTTPProxyAndURL(URL string) TestCase
- func WithNetemHTTPWithTLSProxyAndURL(URL string) TestCase
- func WithNetemSOCKSProxyAndURL(URL string) TestCase
Constants ¶
This section is empty.
Variables ¶
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.
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.