tests

package
v0.0.0-...-109c5d9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestEnv1 *TestEnv

	// client side gateway under test on 5357 (mesh), 16004(socks), 16005(http)
	ClientGW   *mesh.Gateway
	HSClientGW *http.Client
	HPClientGW *http.Client

	// Remote(central) gateway on 14000
	VpnGW   *mesh.Gateway
	HSVpnGW *http.Client
	HPVpnGW *http.Client
)

Functions

func EchoHandler

func EchoHandler(r io.Reader, w io.Writer)

func InitCommonGateways

func InitCommonGateways()

Init common (fixed) est env.

- ClientGW on 16000(DM), 16001(SOCKS), 16002(HPROXY), 16003(SSHClientConn) - HSClientGW and HPClientGW clients set to use ClientGW

- VPNGW on 14000(DM), 14001, 14002 - HSVpnGW, HPVpnGW

- TCP echo on 3000 - UDP echo on 3001 - test http server on 3002, https on 3003

func InitEchoServer

func InitEchoServer(port string)

TCP Echo server on port

func InitEchoUdp

func InitEchoUdp(port int) error

UDP Echo server

func NewLocalListener

func NewLocalListener() net.Listener

func StartH2cServer

func StartH2cServer(handler http.Handler) net.Listener

Start a H2 server over plain text

func TcpEchoTest

func TcpEchoTest(c1 net.Conn)

tests on the 'echo' server. c1 is an established connection to the echo server, possibly using intermediaries.

func TestGateway

func TestGateway(baseport int) *mesh.Gateway

Init a Gateway, with a new set of private keys: - basePort - H2/QUIC MTLS DMesh port - +1 SOCKS - +2 HTTP PROXY - +22 SSHClientConn

Types

type FakeTLSConn

type FakeTLSConn struct {
	net.Conn
}

Used by a H2 server to 'fake' a secure connection.

func (*FakeTLSConn) ConnectionState

func (c *FakeTLSConn) ConnectionState() tls.ConnectionState

type TestEnv

type TestEnv struct {
	NextStatus int
	// contains filtered or unexported fields
}

Small env for testing / probers

func NewTestEnv

func NewTestEnv(basePort int) *TestEnv

Start test servers

func (*TestEnv) ServeHTTP

func (te *TestEnv) ServeHTTP(w http.ResponseWriter, r *http.Request)

HTTP echo/info

Jump to

Keyboard shortcuts

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