Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilConfig = errors.New("nil config parameter supplied") ErrDuplicateListeners = errors.New("duplicate listener addr and port but different type") ErrUnknownListenerType = errors.New("unknown listener type") ErrListenerNotFound = errors.New("listener not found") ErrProxychainNotFound = errors.New("proxychain for backend is not defined") ErrBackendInitFailed = errors.New("backend initialization is not defined") ErrHostListenerClash = errors.New("duplicate host already attached to listener") ErrAttachSiteToListenerFailed = errors.New("failed to attach site to listener") )
var (
ErrDirectProxyAfterNonDirectProxy = errors.New("direct connection does not make sense as non-first member of proxychain")
)
Functions ¶
Types ¶
type DefaultSelector ¶ added in v0.0.2
type DefaultSelector struct { }
DefaultSelector logic implements the default (not specificed) selector. Namely if the backend does not include a specific Host to target, then the Host on the incoming request is used.
func (DefaultSelector) GetTarget ¶ added in v0.0.2
func (d DefaultSelector) GetTarget(backend HTTPBackend, request *http.Request) string
GetTarget implements TargetSelector.
type ErrInvalidProxySpec ¶
type ErrInvalidProxySpec struct {
// contains filtered or unexported fields
}
ErrInvalidProxySpec is the common type for proxy construction errors.
func (ErrInvalidProxySpec) Cause ¶
func (e ErrInvalidProxySpec) Cause() error
func (ErrInvalidProxySpec) Error ¶
func (e ErrInvalidProxySpec) Error() string
type HTTPBackend ¶
type HTTPBackend struct {
// contains filtered or unexported fields
}
func NewHTTPBackend ¶
func NewHTTPBackend(config config.BackendConfig, proxychain Proxychain) (*HTTPBackend, error)
func (HTTPBackend) ServeHTTP ¶
func (h HTTPBackend) ServeHTTP(writer http.ResponseWriter, request *http.Request)
ServerHTTP implements http.Handler.
type HTTPEdgeListener ¶
type HTTPEdgeListener struct {
// contains filtered or unexported fields
}
type PathIndexSelector ¶ added in v0.0.2
type PathIndexSelector struct {
Index int `mapstructure:"Index"` // Index is the position of the path parameter
}
PathIndexSelector splits the URL path into components and extracts the hostname from the given Index. By default, the extracted parameter is removed.
func (PathIndexSelector) GetTarget ¶ added in v0.0.2
func (p PathIndexSelector) GetTarget(backend HTTPBackend, request *http.Request) string
GetTarget implements TargetSelector.
type Proxychain ¶
type Proxychain interface {
Dialer() proxy.ContextDialer
}
Proxychain provides an interface to constructed chains of proxies.
func NewProxychainFromConfig ¶
func NewProxychainFromConfig(cfg []config.Proxy) (Proxychain, error)
NewProxychainFromConfig creates a new proxychain from the supplied list of configs.
type ServerCommand ¶
type ServerCommand struct{}
type TargetSelector ¶ added in v0.0.2
type TargetSelector interface { // GetTarget returns the target GetTarget(backend HTTPBackend, request *http.Request) string }
TargetSelector implements determining the target backend for an HTTP edge proxy.
func NewTargetSelector ¶ added in v0.0.2
func NewTargetSelector(name config.TargetSelectType, parameters map[string]interface{}) TargetSelector