testresponder

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RawNoJSON NDT tests correspond to the code integrated into the uTorrent client.
	RawNoJSON = ServerType(iota)
	// RawJSON NDT tests correspond to code that integrated web100clt anytime after 2016.
	RawJSON
	// WS NDT tests take place over unencrypted websockets.
	WS
	// WSS NDT tests take place over encrypted websockets.
	WSS
)

Variables

This section is empty.

Functions

func MakeNdtUpgrader

func MakeNdtUpgrader(protocols []string) websocket.Upgrader

MakeNdtUpgrader creates a websocket Upgrade for the NDT legacy

Types

type Config

type Config struct {
	KeyFile, CertFile string
	ServerType        ServerType
}

Config expresses the configuration of the server, and whether to use TLS or not.

type ServerType

type ServerType int

ServerType indicates what type of NDT test the particular server is performing. There are extant active clients for each of these protocol variations.

type TestResponder

type TestResponder struct {
	Port   int
	Ln     net.Listener
	S      *http.Server
	Ctx    context.Context
	Cancel context.CancelFunc
	Config *Config
}

TestResponder coordinates synchronization between the main control loop and subtests.

func (*TestResponder) Close

func (tr *TestResponder) Close()

Close will shutdown, cancel, or close all resources used by the test.

func (*TestResponder) StartAsync

func (tr *TestResponder) StartAsync(mux *http.ServeMux, rawTest func(protocol.MeasuredConnection), msg string) error

StartAsync allocates a new TLS HTTP server listening on a random port. The server can be stopped again using TestResponder.Close().

Jump to

Keyboard shortcuts

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