Documentation
¶
Overview ¶
Package proxytest is a test infrastructure package to create TestProxy instances.
cert.go:
Generate a self-signed X.509 certificate for a TLS server. Based on https://go.dev/src/crypto/tls/generate_cert.go
Index ¶
- func NewCertificate(hosts ...string) tls.Certificate
- type Config
- type TestClient
- type TestProxy
- func New(fr filters.Registry, routes ...*eskip.Route) *TestProxy
- func WithParams(fr filters.Registry, proxyParams proxy.Params, routes ...*eskip.Route) *TestProxy
- func WithParamsAndRoutingOptions(fr filters.Registry, proxyParams proxy.Params, o routing.Options, ...) *TestProxy
- func WithParamsAndRoutingOptionsAndWait(fr filters.Registry, proxyParams proxy.Params, o routing.Options, ...) *TestProxy
- func WithParamsAndRoutingOptionsAndWaitUnstarted(fr filters.Registry, proxyParams proxy.Params, o routing.Options, ...) *TestProxy
- func WithRoutingOptions(fr filters.Registry, o routing.Options, routes ...*eskip.Route) *TestProxy
- func WithRoutingOptionsWithWait(fr filters.Registry, o routing.Options, wait time.Duration, ...) *TestProxy
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
WaitTime time.Duration // Optional wait time, defaults to 3s if zero
}
func (Config) CreateUnstarted ¶ added in v0.24.28
type TestClient ¶ added in v0.16.37
func (*TestClient) Do ¶ added in v0.27.59
Do sends the HTTP request. If the request already has a Cookie header (manually added cookies), the cookie jar is temporarily disabled so that jar cookies do not interfere with the request. This allows tests that manually construct requests with specific cookies to avoid cross-test cookie interference while still supporting automatic cookie handling for full browser-like flows.
type TestProxy ¶
type TestProxy struct {
URL string
Port string
Log *loggingtest.Logger
// contains filtered or unexported fields
}
func WithParams ¶
func WithParamsAndRoutingOptions ¶ added in v0.13.258
func WithParamsAndRoutingOptionsAndWait ¶ added in v0.22.171
func WithParamsAndRoutingOptionsAndWaitUnstarted ¶ added in v0.24.28
func WithRoutingOptions ¶ added in v0.9.206
func WithRoutingOptionsWithWait ¶ added in v0.22.133
func (*TestProxy) Client ¶ added in v0.15.21
func (p *TestProxy) Client() *TestClient
func (*TestProxy) SetListener ¶ added in v0.24.28
Click to show internal directories.
Click to hide internal directories.