safehttp

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(options Options) *http.Client

NewClient returns an HTTP client that can block selected local address ranges.

func NewSafeTransport

func NewSafeTransport(options Options) http.RoundTripper

Types

type Options

type Options struct {
	BlockLoopback  bool
	BlockPrivateIP bool
	BlockLinkLocal bool
	AllowList      []string
	Timeout        time.Duration
	Headers        http.Header
	TokenSource    oauth2.TokenSource
	// DialRetryTimeout bounds retries of transient TCP failures before any HTTP bytes are sent.
	DialRetryTimeout time.Duration
}

Jump to

Keyboard shortcuts

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