proxytest

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0, MIT Imports: 21 Imported by: 0

Documentation

Overview

Generate a self-signed X.509 certificate for a TLS server. Based on https://go.dev/src/crypto/tls/generate_cert.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCertificate added in v0.15.21

func NewCertificate(hosts ...string) tls.Certificate

Types

type Config added in v0.15.21

type Config struct {
	RoutingOptions routing.Options
	ProxyParams    proxy.Params
	Routes         []*eskip.Route
	Certificates   []tls.Certificate
}

func (Config) Create added in v0.15.21

func (c Config) Create() *TestProxy

type TestClient added in v0.16.37

type TestClient struct {
	*http.Client
}

func (*TestClient) GetBody added in v0.16.37

func (c *TestClient) GetBody(url string) (rsp *http.Response, body []byte, err error)

GetBody issues a GET to the specified URL, reads and closes response body and returns response, response body bytes and error if any.

type TestProxy

type TestProxy struct {
	URL  string
	Port string
	Log  *loggingtest.Logger
	// contains filtered or unexported fields
}

func New

func New(fr filters.Registry, routes ...*eskip.Route) *TestProxy

func WithParams

func WithParams(fr filters.Registry, proxyParams proxy.Params, routes ...*eskip.Route) *TestProxy

func WithParamsAndRoutingOptions added in v0.13.258

func WithParamsAndRoutingOptions(fr filters.Registry, proxyParams proxy.Params, o routing.Options, routes ...*eskip.Route) *TestProxy

func WithRoutingOptions added in v0.9.206

func WithRoutingOptions(fr filters.Registry, o routing.Options, routes ...*eskip.Route) *TestProxy

func (*TestProxy) Client added in v0.15.21

func (p *TestProxy) Client() *TestClient

func (*TestProxy) Close

func (p *TestProxy) Close() error

Jump to

Keyboard shortcuts

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