proxy

package
v0.0.0-...-e77b2b6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package proxy sends HTTP requests to a supervised child process with Caddy's own reverse proxy - WebSockets, streaming and the X-Forwarded-* headers included - and answers 503 with Retry-After while the child is not accepting connections yet, so a client sees "starting" rather than a gateway error. caddy-gitea-plugin and caddy-wekan-plugin both use it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

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

Proxy is a reverse proxy to one child process.

func New

func New(ctx caddy.Context, name, dial string, ready func() bool) (*Proxy, error)

New provisions a reverse proxy to dial ("host:port" or "unix//path"). ready reports whether the child accepts connections.

func (*Proxy) Cleanup

func (p *Proxy) Cleanup() error

Cleanup releases the reverse proxy.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP proxies the request, or answers 503 while the child is starting.

Jump to

Keyboard shortcuts

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