proxypass

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitModule

func InitModule(cfg jconf.SubConfig) (rpmod rproxymod.ProxyModule, err error)

Types

type Config

type Config struct {
	RewriteHost    bool // Rewrite Host header to match target URL
	RewriteForward bool // Rewrite incoming URI headers like "Destination"
	RewriteReverse bool // Rewrite outgoing URI headers like "Location"
	Headers        ProxyHeadersConfig
}

type Module

type Module struct {
	rproxymod.BaseModule
	Config
}

func (*Module) Deinit

func (mod *Module) Deinit() error

func (*Module) ModifyResponse

func (mod *Module) ModifyResponse(reqCtx *rproxymod.RequestContext, inReq *http.Request, resp *http.Response) error

func (*Module) ProcessRequest

func (mod *Module) ProcessRequest(reqCtx *rproxymod.RequestContext, inReq *http.Request, proxyReq *http.Request) (res *http.Response, err error)

Remember to test reqCtx.CopiedHeaders and maybe copy headers before modifying them.

type ProxyHeadersConfig

type ProxyHeadersConfig struct {
	XFwdFor    bool   `json:"X-Forwarded-For,omitempty"`
	XFwdHost   bool   `json:"X-Forwarded-Host,omitempty"`
	XFwdServer bool   `json:"X-Forwarded-Server,omitempty"`
	XFwdProto  bool   `json:"X-Forwarded-Proto,omitempty"`
	Forwarded  string `json:"Forwarded,omitempty"` // RFC7239
	Via        string `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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