httpproxy

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package httpproxy provides an HTTP proxy implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromURL added in v1.0.1

func FromURL(u *url.URL, forward proxy.Dialer) (proxy.Dialer, error)

FromURL returns a proxy.Dialer given a URL specification and an underlying Dialer for it to make network requests.

func NewDialer added in v1.0.1

func NewDialer(address string, tlsConfig *tls.Config, pa *proxy.Auth, forward proxy.Dialer) (proxy.Dialer, error)

NewDialer returns a Dialer that makes HTTP connections to the given address with an optional username and password. If tlsConfig is provided, the Dialer will make HTTPS connecitons.

Types

type Dialer

type Dialer struct {

	// TLSConfig is the optional TLS configuration for HTTPS connections.
	TLSConfig *tls.Config

	// ProxyDial specifies the optional dial function for
	// establishing the transport connection.
	ProxyDial func(context.Context, string, string) (net.Conn, error)

	// Auth contains authentication information for the proxy.
	Auth auth.Authorization
	// contains filtered or unexported fields
}

Dialer represents a proxy dialer

func (*Dialer) Dial

func (d *Dialer) Dial(network, address string) (conn net.Conn, err error)

Dial connects to the address on the named network using the proxy.

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, network, address string) (conn net.Conn, err error)

DialContext connects to the address on the named network using the proxy with the provided context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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