reverseproxy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPHandler

type HTTPHandler struct {
	// required, the URL that requests will be forwarding to
	To *url.URL

	// required, internal reverse proxy that forwards the requests
	ReverseProxy *httputil.ReverseProxy

	// optional, preserve the host in outbound requests
	PreserveHost bool

	// optional, but in fact required, injecting fingerprint headers to outbound requests
	HeaderInjectors []HeaderInjector
}

func NewHTTPHandler

func NewHTTPHandler(to *url.URL, reverseProxy *httputil.ReverseProxy, headerInjectors []HeaderInjector) *HTTPHandler

func (*HTTPHandler) ServeHTTP

func (f *HTTPHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*HTTPHandler) SetReverseProxyRewriteFunc

func (f *HTTPHandler) SetReverseProxyRewriteFunc()

type HeaderInjector

type HeaderInjector interface {
	GetHeaderName() string

	GetHeaderValue(req *http.Request) (string, error)
}

Jump to

Keyboard shortcuts

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