Documentation ¶
Index ¶
- func New(hostMapper HostMapper, opts ...Options) http.Handler
- func ReplaceCookieDomainAndSecure(resp *http.Response, original, replacement string, secure bool)
- type HostConfig
- type HostMapper
- type Options
- func WithErrorHandler(eh func(w http.ResponseWriter, r *http.Request, err error)) Options
- func WithOnError(onReqErr func(*http.Request, error), ...) Options
- func WithReqMiddleware(middlewares ...ReqMiddleware) Options
- func WithRespMiddleware(middlewares ...RespMiddleware) Options
- func WithTransport(t http.RoundTripper) Options
- type ReqMiddleware
- type RespMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HostConfig ¶
type HostConfig struct { // CorsEnabled is a flag to enable or disable CORS // Default: false CorsEnabled bool // CorsOptions allows to configure CORS // If left empty, no CORS headers will be set even when CorsEnabled is true CorsOptions *cors.Options // CookieDomain is the host under which cookies are set. // If left empty, no cookie domain will be set CookieDomain string // UpstreamHost is the next upstream host the proxy will pass the request to. // e.g. fluffy-bear-afiu23iaysd.oryapis.com UpstreamHost string // UpstreamScheme is the protocol used by the upstream service. UpstreamScheme string // TargetHost is the final target of the request. Should be the same as UpstreamHost // if the request is directly passed to the target service. TargetHost string // TargetScheme is the final target's scheme // (i.e. the scheme the target thinks it is running under) TargetScheme string // PathPrefix is a prefix that is prepended on the original host, // but removed before forwarding. PathPrefix string // TrustForwardedHosts is a flag that indicates whether the proxy should trust the // X-Forwarded-* headers or not. TrustForwardedHeaders bool // ForceOriginalSchemeHTTP forces the original scheme to be https if enabled. ForceOriginalSchemeHTTPS bool // contains filtered or unexported fields }
type HostMapper ¶ added in v0.0.309
type Options ¶
type Options func(*options)
func WithErrorHandler ¶ added in v0.0.450
func WithOnError ¶
func WithReqMiddleware ¶
func WithReqMiddleware(middlewares ...ReqMiddleware) Options
func WithRespMiddleware ¶
func WithRespMiddleware(middlewares ...RespMiddleware) Options
func WithTransport ¶
func WithTransport(t http.RoundTripper) Options
type ReqMiddleware ¶
type ReqMiddleware func(req *httputil.ProxyRequest, config *HostConfig, body []byte) ([]byte, error)
type RespMiddleware ¶
Click to show internal directories.
Click to hide internal directories.