proxy

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package proxy implements the support for an upstream (outgoing) proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Type is the proxy type (Eg: "none"," socks5", "tor+socks5").
	Type string

	// Network is the proxy address' network (`unix`, `tcp`).
	Network string

	// Address is the proxy's address.
	Address string

	// User is the optional proxy username.
	User string

	// Password is the optional proxy password.
	Password string
	// contains filtered or unexported fields
}

Config is the proxy configuration.

func (*Config) FixupAndValidate

func (cfg *Config) FixupAndValidate() error

FixupAndValidate applies defaults to config entires and validates the supplied configuration.

func (*Config) ToDialContext

func (cfg *Config) ToDialContext(tag string) DialContextFn

ToDialContext returns a function matching Dialer.DialContext() that will utilize the configured proxy or nil iff no proxy is configured.

type DialContextFn

type DialContextFn func(context.Context, string, string) (net.Conn, error)

DialContextFn is a function that matches the Dialer.DialContext prototype.

Jump to

Keyboard shortcuts

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