proxy

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package proxy implements Inkwall's standalone mode: an HTTP reverse proxy that inspects each request and forwards allowed ones to an upstream.

It is used in front of services without a supported ingress, and it is the reference adapter: every other adapter must reach the same verdict for the same request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Upstream is the service that allowed requests are forwarded to.
	Upstream *url.URL
	// MaxBodyBytes is how much of a request body is inspected. The rest is
	// streamed to the upstream uninspected. Zero disables body inspection.
	MaxBodyBytes int64
	// ClientIP resolves the client address behind trusted proxies. Nil
	// trusts no proxies.
	ClientIP *clientip.Resolver
	// Logger receives one security event per denied or logged request.
	// Nil uses slog.Default().
	Logger *slog.Logger
	// Events records each security event for the operator (nil: logged
	// only).
	Events *events.Recorder
}

Config configures a Handler.

type Handler

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

Handler is an inspecting reverse proxy.

func New

func New(p pipeline.Inspector, cfg Config) (*Handler, error)

New returns a Handler that inspects requests with p.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP inspects r, then denies it or forwards it to the upstream.

Jump to

Keyboard shortcuts

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