Documentation
¶
Index ¶
Constants ¶
View Source
const ( BasicAuthName = "Basic" ProxyAuthorizationKey = "Proxy-Authorization" ProxyAuthenticateKey = "Proxy-Authenticate" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type Authentication interface {
Auth(http.ResponseWriter, *http.Request) bool
}
Authentication proxy authentication
func BasicAuth ¶
func BasicAuth(username, password string) Authentication
BasicAuth HTTP Basic authentication for Header Proxy-Authorization
func BasicAuthFunc ¶
func BasicAuthFunc(f func(username, password string) bool) Authentication
BasicAuthFunc HTTP Basic authentication for Header Proxy-Authorization
type AuthenticationFunc ¶
type AuthenticationFunc func(http.ResponseWriter, *http.Request) bool
AuthenticationFunc Authentication interface is implemented
func (AuthenticationFunc) Auth ¶
func (f AuthenticationFunc) Auth(w http.ResponseWriter, r *http.Request) bool
Auth authentication processing
type Dialer ¶
type Dialer struct { // ProxyDial specifies the optional dial function for // establishing the transport connection. ProxyDial func(context.Context, string, string) (net.Conn, error) // TLSClientConfig specifies the TLS configuration to use with // tls.Client. // If nil, the TLS is not used. // If non-nil, HTTP/2 support may not be enabled by default. TLSClientConfig *tls.Config // contains filtered or unexported fields }
Dialer holds HTTP CONNECT options.
type ProxyHandler ¶
type ProxyHandler struct { Client *http.Client ProxyDial func(context.Context, string, string) (net.Conn, error) Authentication Authentication NotFound http.Handler // contains filtered or unexported fields }
ProxyHandler proxy handler
func (*ProxyHandler) ServeHTTP ¶
func (p *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.