middleware

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(realm string, fn func(username, password string) bool) mps.MiddlewareFunc

BasicAuth returns a HTTP Basic Authentication middleware for requests You probably want to use mps.BasicAuth(proxy) to enable authentication for all proxy activities

func BasicUnauthorized

func BasicUnauthorized(req *http.Request, realm string) *http.Response

func SetBasicAuth

func SetBasicAuth(req *http.Request, username, password string)

SetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.

With HTTP Basic Authentication the provided username and password are not encrypted.

Some protocols may impose additional requirements on pre-escaping the username and password. For instance, when used with OAuth2, both arguments must be URL encoded first with url.QueryEscape.

func SingleHostReverseProxy

func SingleHostReverseProxy(target *url.URL) mps.MiddlewareFunc

SingleHostReverseProxy returns a mps.Middleware URLs to the scheme, host, and base path provided in target. If the target's path is "/base" and the incoming request was for "/dir", the target request will be for /base/dir. SingleHostReverseProxy does not rewrite the Host header. To rewrite Host headers, use ReverseProxy directly with a custom Director policy.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL