Documentation
¶
Overview ¶
Package proxy declares the endpoint that reaches peers through their tunnels: where it serves and how it routes. The data plane underneath is package revproxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface{ ApplyProxy(*Proxy) }
Option configures a Proxy; every EndpointOption is one too.
func WithErrorHook ¶
WithErrorHook observes requests the proxy could not serve, with a low-cardinality reason. See revproxy.ErrorHook.
func WithRequestCapture ¶ added in v0.43.0
WithRequestCapture adds the payload to what the request hook reports: headers (credential values redacted) and up to limit bytes of each body. Off by default; capture is bounded per request and never stored.
func WithRequestHook ¶ added in v0.36.0
WithRequestHook reports every request the proxy carried, once the response is done. See reqlog.Hook.
func WithResolvers ¶
WithResolvers appends custom resolvers to the chain, tried after the ones WithRouting names (or instead of the default when no strategy is configured). Repeatable.
func WithRouting ¶
WithRouting sets how the proxy picks the target peer; domain is the base domain for the subdomain strategies. The pair is resolved when the server runs — an unusable combination is an error there, not a proxy that routes nothing. See revproxy.Routing.
type Proxy ¶
type Proxy struct {
utils.Endpoint
Opts []revproxy.Option
// Hook and Capture configure the request log the server wraps
// around the data plane; the proxy itself knows nothing of it.
Hook reqlog.Hook
Capture []reqlog.Option
// Routing and Domain hold the configured strategy; the server
// resolves them at Run, so a bad pair fails before binding.
Routing revproxy.Routing
Domain string
// Resolvers are custom resolvers appended after the strategy's.
Resolvers []revproxy.Resolver
}
Proxy is the endpoint that reaches peers through their tunnels. Build it with NewProxy.