Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "1.0.0"
Version is the version of this package.
Functions ¶
func NewHTTPError ¶
NewHTTPError creates a new HTTPError.
func ParseHostPort ¶
ParseHostPort parses host and port from a string in the form host[:port].
Types ¶
type BufferPool ¶
A BufferPool is an interface for getting and returning temporary byte slices for use by io.CopyBuffer.
type Config ¶
type Config struct {
OnRequest func(req *http.Request) error
OnResponse func(res *http.Response) error
OnError func(err error, rw http.ResponseWriter, req *http.Request)
}
Config is the configuration for the Proxy.
type HTTPError ¶
type HTTPError struct {
// contains filtered or unexported fields
}
HTTPError is an error that wraps an HTTP status code.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is a Powerful HTTP Proxy, inspired by Go Reverse Proxy.
func NewSingleTarget ¶
func NewSingleTarget(target string, cfg ...*SingleTargetConfig) *Proxy
NewSingleTarget creates a new SingleTarget Proxy.
type SingleTargetConfig ¶
type SingleTargetConfig struct {
Rewrites map[string]string
Scheme string
Query url.Values
RequestHeaders http.Header
ResponseHeaders http.Header
OnRequest func(req *http.Request) error
OnResponse func(res *http.Response) error
}
SingleTargetConfig is the configuration for SingleTarget.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.