requestutil

package
v0.6.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2016 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateForwardedRequest

func GenerateForwardedRequest(req *http.Request, addr string) (*http.Request, error)

GenerateForwardedRequest generates a new http.Request that contains the original requests's information in the new request's body.

func ParseForwardedRequest

func ParseForwardedRequest(req *http.Request) (*http.Request, error)

ParseForwardedRequest generates a new http.Request that is comprised of the values in the given request's body, assuming it correctly parses into a ForwardedRequest.

Types

type ForwardedRequest

type ForwardedRequest struct {
	// The original method
	Method string `json:"method"`

	// The original URL object
	URL *url.URL `json:"url"`

	// The original headers
	Header http.Header `json:"header"`

	// The request body
	Body []byte `json:"body"`

	// The specified host
	Host string `json:"host"`

	// The remote address
	RemoteAddr string `json:"remote_addr"`

	// The client's TLS connection state
	ConnectionState *tls.ConnectionState `json:"connection_state"`
}

Jump to

Keyboard shortcuts

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