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 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
// 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.