handlers

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSourceIP

func GetSourceIP(r *http.Request) string

GetSourceIP retrieves the IP from the X-Forwarded-For, X-Real-IP and RFC7239 Forwarded headers (in that order), falls back to r.RemoteAddr when all else fails.

func GetSourceScheme

func GetSourceScheme(r *http.Request) string

GetSourceScheme retrieves the scheme from the X-Forwarded-Proto and RFC7239 Forwarded headers (in that order).

Types

type Forwarder

type Forwarder struct {
	RoundTripper http.RoundTripper
	PassHost     bool
	Logger       func(error)
	// contains filtered or unexported fields
}

Forwarder forwards all incoming HTTP requests to configured transport.

func NewForwarder

func NewForwarder(f *Forwarder) *Forwarder

NewForwarder creates an instance of Forwarder based on the provided list of configuration options

func (*Forwarder) ServeHTTP

func (f *Forwarder) ServeHTTP(w http.ResponseWriter, inReq *http.Request)

ServeHTTP forwards HTTP traffic using the configured transport

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL