mailproxy: Index | Files

package proxy

import ""

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


Package Files


type Config Uses

type Config struct {
    // PreferedTransports is a list of the transports will be used to make
    // outgoing network connections, with the most prefered first.
    PreferedTransports []pki.Transport

    // 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 Uses

func (cfg *Config) FixupAndValidate() error

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

func (*Config) ToDialContext Uses

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 Uses

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

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

Package proxy imports 12 packages (graph) and is imported by 3 packages. Updated 2018-09-29. Refresh now. Tools for package owners.