package
0.30.0
Repository: https://github.com/ooni/probe-engine.git
Documentation: pkg.go.dev

# Functions

HTTPHandlerBlockpage451 returns a handler that returns 451 along with a blockpage.
HTTPHandlerEOF returns a handler that immediately closes the connection.
HTTPHandlerReset returns a handler that immediately resets the connection.
HTTPHandlerResetWhileReadingBody returns a handler that sends a connection reset by peer while the client is reading the body.
HTTPHandlerTimeout returns a handler that never returns a response and instead blocks on the request context, thus causing a client timeout.
MustNewDNSOverUDPListener creates a new [DNSOverUDPListener] using the given [DNSOverUDPUnderlyingListener], [DNSRoundTripper], and [*net.UDPAddr].
MustNewDNSSimulateGWFListener creates a new [DNSSimulateGWFListener] using the given [DNSOverUDPUnderlyingListener], [*net.UDPAddr], and [*netem.DNSConfig].
MustNewHTTPServer is morally equivalent to [httptest.NewHTTPServer].
MustNewHTTPServerEx creates a new [HTTPServer] using HTTP or PANICS.
MustNewHTTPServerTLS is morally equivalent to [httptest.NewHTTPServerTLS].
MustNewHTTPServerTLSEx creates a new [HTTPServer] using HTTPS or PANICS.
MustNewTLSServer is a simplified [MustNewTLSServerEx] that uses the stdlib and localhost.
MustNewTLSServerEx creates and starts a new TLSServer that executes the given action during the TLS handshake.
MustNewTLSSNIProxyEx creates a new [*TLSSNIProxy].
NewDNSRoundTripperEmptyRespnse is a [DNSRoundTripper] that always returns an empty response.
NewDNSRoundTripperNXDOMAIN is a [DNSRoundTripper] that always returns NXDOMAIN.
NewDNSRoundTripperRefused is a [DNSRoundTripper] that always returns refused.
NewDNSRoundTripperSimulateTimeout is a [DNSRoundTripper] that sleeps for the given amount of time and then returns to the caller the given error.
NewDNSRoundTripperWithDNSConfig implements [DNSRroundTripper] using a [*netem.DNSConfig].
NewHTTPProxyHandler constructs a new [*HTTPProxyHandler].
NewTimeDeterministic creates a new instance using the given zeroTime value.
TLSHandlerEOF closes the connection during the handshake.
TLSHandlerHandshakeAndWriteText returns a [TLSHandler] that attempts to complete the handshake and returns the given text to the caller.
TLSHandlerReset resets the connection.
TLSHandlerSendAlert sends the alert given as argument to the client.
TLSHandlerTimeout returns a [TLSHandler] that reads data and never writes eventually causing the client connection to timeout.

# Constants

TLSAlertInternalError is the alter sent on internal errors.
TLSAlertUnrecognizedName is the alert sent when the name is not recognized.

# Variables

HTTPBlockPage451 is the block page returned along with status 451.

# Structs

CloseVerify verifies that we're closing all connections.
DNSOverHTTPSHandler is an [http.Handler] implementing DNS-over-HTTPS.
DNSOverUDPListener is a DNS-over-UDP listener.
DNSOverUDPListenerStdlib implements [DNSOverUDPUnderlyingListener] using the standard library.
DNSSimulateGWFListener is a DNS-over-UDP listener that simulates the GFW behavior by responding with N+1 answers, where the first N answers are invalid for the domain and the last answer is correct for the domain.
FakeFiller fills specific data structures with random data.
GeoIPHandlerUbuntu is an [http.Handler] implementing Ubuntu's GeoIP lookup service.
HTTPServer is a server tuned for testing that works with both the standard library and netem as its net backend.
Logger implements [logmodel.Logger] and collects all the log lines.
OONIBackendWithLoginFlow implements the register and login workflows and serves the psiphon config and tor targets.
OONIBackendWithLoginFlowUserRecord is a user record used by [OONIBackendWithLoginFlow].
OONICollector implements the OONI collector for testing.
TCPListenerStdlib implements [HTTPListener] for the stdlib.
TimeDeterministic implements time.Now in a deterministic fashion such that every time.Time call returns a moment in time that occurs one second after the configured zeroTime.
TLSServer is a TLS server useful to implement test servers.
TLSSNIProxy is a proxy using the SNI to figure out where to connect to.

# Interfaces

DNSOverUDPUnderlyingListener is the underlying listener used by [DNSOverUDPListener].
DNSRoundTripper performs DNS round trips.
HTTPProxyHandlerNetx abstracts [*netxlite.Netx] for the [*HTTPProxyHandler].
TCPListener creates TCP connections for HTTP, TLS, etc.
TLSConn is the interface assumed by an established TLS conn.
TLSConnHandler is the interface implemented by handlers that want to handle and manage the established TLS connection after the handshake.
TLSHandler handles TLS connections.
TLSSNIProxyNetx is how [TLSSNIProxy] views [*netxlite.Netx].

# Type aliases

DNSNumBogusResponses is a type indicating the number of bogus responses the [DNSSimulateGWFListener] should emit for each round trip.
DNSRoundTripperFunc makes a func implement the [DNSRoundTripper] interface.