proxy

package
v0.0.0-...-4feb759 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ContextSecure = "secure"

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackFn

type CallbackFn func(resp *http.Response)

CallbackFn provides a callback function for logging request data.

type Config

type Config struct {
	// Addr provides the remote address to use for proxying requests to.
	Addr string
	// Mountpoints provides a list of static mountpoints for this proxy.
	Mountpoints []*Mountpoint
}

Config provides the configuration for a proxy instance.

type Mountpoint

type Mountpoint struct {
	Path string
	Dir  string
}

Mountpoint represents a static path and directory on-disk.

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy acts as a reverse proxy and static file server for a specific site.

func New

func New(cfg *Config) *Proxy

New creates and initializes a new proxy for a domain.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Proxy) SetCallback

func (p *Proxy) SetCallback(callbackFn CallbackFn)

SetCallback specifies a callback for requests & responses.

Jump to

Keyboard shortcuts

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