Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReverseProxy ¶
type ReverseProxy struct { // Logger specifies a logger for errors that occur when attempting // to proxy the request. Logger types.Logger Settings Settings CodesToRetry map[int]string // contains filtered or unexported fields }
ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.
func New ¶
func New(cfg *config.Handler, l *types.Location, next types.RequestHandler) (*ReverseProxy, error)
New returns a configured and ready to use Upstream instance.
func (*ReverseProxy) RequestHandle ¶
func (p *ReverseProxy) RequestHandle(ctx context.Context, w http.ResponseWriter, r *http.Request)
RequestHandle implements the nedomi interface
func (*ReverseProxy) ServeHTTP ¶
func (p *ReverseProxy) ServeHTTP(ctx context.Context, rw http.ResponseWriter, req *http.Request)
type Settings ¶
type Settings struct { UserAgent string `json:"user_agent"` HostHeader string `json:"host_header"` HostHeaderKeepOriginal bool `json:"host_header_keep_original"` UpstreamHashPrefix string `json:"upstream_hash_prefix"` TryOtherUpstreamOnCode map[string]string `json:"try_other_upstream_on_code"` }
Settings contains the possible settings for the proxy
Click to show internal directories.
Click to hide internal directories.