proxyutil

package
v6.8.52 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDirectTransport

func NewDirectTransport() *http.Transport

NewDirectTransport returns a transport that bypasses environment proxies.

Types

type Mode

type Mode int

Mode describes how a proxy setting should be interpreted.

const (
	// ModeInherit means no explicit proxy behavior was configured.
	ModeInherit Mode = iota
	// ModeDirect means outbound requests must bypass proxies explicitly.
	ModeDirect
	// ModeProxy means a concrete proxy URL was configured.
	ModeProxy
	// ModeInvalid means the proxy setting is present but malformed or unsupported.
	ModeInvalid
)

func BuildDialer

func BuildDialer(raw string) (proxy.Dialer, Mode, error)

BuildDialer constructs a proxy dialer for settings that operate at the connection layer.

func BuildHTTPTransport

func BuildHTTPTransport(raw string) (*http.Transport, Mode, error)

BuildHTTPTransport constructs an HTTP transport for the provided proxy setting.

type Setting

type Setting struct {
	Raw  string
	Mode Mode
	URL  *url.URL
}

Setting is the normalized interpretation of a proxy configuration value.

func Parse

func Parse(raw string) (Setting, error)

Parse normalizes a proxy configuration value into inherit, direct, or proxy modes.

Jump to

Keyboard shortcuts

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